for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the CMS Kernel package.
*
* Copyright (c) 2016-present LIN3S <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace LIN3S\CMSKernel\Domain\Model\Menu;
/**
* @author Beñat Espiña <[email protected]>
class MenuItem
{
private $id;
private $link;
private $order;
private $createdOn;
private $updatedOn;
private $parentId;
* This is a hack to make more readable database schema.
* This property is populated by reflection from MenuTranslation.
private $menuTranslation;
$menuTranslation
This check marks private properties in classes that are never used. Those properties can be removed.
public function __construct(MenuItemId $id, MenuItemLink $link, MenuItemOrder $order, MenuItemId $parentId = null)
$this->id = $id;
$this->link = $link;
$this->order = $order;
$this->parentId = $parentId;
$this->createdOn = new \DateTimeImmutable();
$this->updatedOn = new \DateTimeImmutable();
}
public function changeParent(MenuItemId $parentId = null)
public function id()
return $this->id;
public function link()
return $this->link;
public function order()
return $this->order;
public function parentId()
return $this->parentId;
public function createdOn()
return $this->createdOn;
public function updatedOn()
return $this->updatedOn;
public function __toString()
return (string) $this->id->id();
This check marks private properties in classes that are never used. Those properties can be removed.