for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types = 1);
namespace Everlution\Navigation;
/**
* Interface Navigation.
* @author Ivan Barlog <[email protected]>
*/
class RootNavigationItem implements Item
{
/** @var string */
private $identifier;
private $label;
/** @var Item[] */
private $children;
public function __construct(string $identifier, string $label = null)
$this->identifier = $identifier;
$this->label = $label ?? $identifier;
}
* @return string
public function getIdentifier(): string
return $this->identifier;
public function getLabel(): string
return $this->label;
* @return array
public function getChildren(): array
return $this->children;
* @param Item $item
* @return Item
public function addChild(Item $item)
$this->children[] = $item;
return $this;
* @param Item $parent
* @throws \Exception
public function setParent(Item $parent)
throw new \Exception(sprintf('%s cannot have parent', self::class));
* @return Item|null
public function getParent()
return null;