mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-28 23:05:11 +02:00
Fixed code style.
This commit is contained in:
parent
1aed1d1d26
commit
9a7223a301
142 changed files with 534 additions and 716 deletions
|
@ -21,10 +21,8 @@
|
|||
|
||||
namespace App\Helpers\Trees;
|
||||
|
||||
|
||||
use App\Entity\Base\StructuralDBElement;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use RecursiveIterator;
|
||||
|
||||
class StructuralDBElementIterator extends \ArrayIterator implements \RecursiveIterator
|
||||
{
|
||||
|
@ -37,22 +35,24 @@ class StructuralDBElementIterator extends \ArrayIterator implements \RecursiveIt
|
|||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function hasChildren()
|
||||
{
|
||||
/** @var StructuralDBElement $element */
|
||||
$element = $this->current();
|
||||
|
||||
return !empty($element->getSubelements());
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getChildren()
|
||||
{
|
||||
/** @var StructuralDBElement $element */
|
||||
$element = $this->current();
|
||||
return new StructuralDBElementIterator($element->getSubelements()->toArray());
|
||||
|
||||
return new self($element->getSubelements()->toArray());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue