Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
pvsaintpe committed May 16, 2024
1 parent 3863237 commit 4f3c227
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 3 deletions.
14 changes: 14 additions & 0 deletions .run/functional.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="functional" type="PHPUnitRunConfigurationType" factoryName="PHPUnit">
<CommandLine parameters="-d memory_limit=-1">
<PhpTestInterpreterSettings>
<option name="interpreterName" value="PHP 8.3" />
</PhpTestInterpreterSettings>
<envs>
<env name="xdebug.mode" value="coverage" />
</envs>
</CommandLine>
<TestRunner configuration_file="$PROJECT_DIR$/../phpunit.xml" directory="$PROJECT_DIR$/tests/functional" use_alternative_configuration_file="true" />
<method v="2" />
</configuration>
</component>
14 changes: 14 additions & 0 deletions .run/tests.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="tests" type="PHPUnitRunConfigurationType" factoryName="PHPUnit">
<CommandLine parameters="-d memory_limit=-1">
<PhpTestInterpreterSettings>
<option name="interpreterName" value="PHP 8.3" />
</PhpTestInterpreterSettings>
<envs>
<env name="xdebug.mode" value="coverage" />
</envs>
</CommandLine>
<TestRunner configuration_file="$PROJECT_DIR$/phpunit.xml" directory="$PROJECT_DIR$/tests" use_alternative_configuration_file="true" />
<method v="2" />
</configuration>
</component>
2 changes: 1 addition & 1 deletion src/Collections/LTreeCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ private function excludeLeaves(): void
{
foreach ($this->items as $key => $item) {
/** @var LTreeModelTrait $item */
if ($item->ltreeChildren->isEmpty()) {
if ($item->ltreeChildren->isEmpty() && $item->getLtreeParentId()) {
$this->forget($key);
}
}
Expand Down
2 changes: 0 additions & 2 deletions src/Interfaces/LTreeModelInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ interface LTreeModelInterface extends HasLTreeRelations, HasLTreeScopes, ModelIn
{
public function getLtreeProxyDeleteColumns(): array;
public function getLtreeProxyUpdateColumns(): array;

public function isParentOf(int $id): bool;

public function getAncestorByLevel(int $level = 1);
}

0 comments on commit 4f3c227

Please sign in to comment.