| 1 | <?php |
||
| 8 | class MenuBuilder implements AuthenticatedUserAwareInterface |
||
| 9 | { |
||
| 10 | use AuthenticatedUserAwareTrait; |
||
| 11 | |||
| 12 | /** @var FactoryInterface */ |
||
| 13 | private $factory; |
||
| 14 | |||
| 15 | public function __construct(FactoryInterface $factory) |
||
| 19 | |||
| 20 | public function createMainMenu(array $options) |
||
|
|
|||
| 21 | { |
||
| 22 | $menu = $this->factory->createItem('root'); |
||
| 23 | |||
| 24 | $menu->addChild('Home', ['route' => 'homepage']) |
||
| 25 | ->setExtra('icon', 'home fa-lg'); |
||
| 26 | $menu->addChild('Bookmarks', ['route' => 'bookmark.index']) |
||
| 27 | ->setExtra('icon', 'bookmark'); |
||
| 28 | $mailItem = $menu->addChild('Mail', ['route' => 'mail.index']) |
||
| 29 | ->setExtra('icon', 'envelope'); |
||
| 30 | $menu->addChild('K', ['uri' => '#']) |
||
| 31 | ->setExtra('icon', 'newspaper-o'); |
||
| 32 | |||
| 33 | if (($mailCount = $this->authenticatedUser->getMailCount())) { |
||
| 34 | $mailItem->setExtra('label', [ |
||
| 35 | 'content' => $mailCount, |
||
| 36 | ]); |
||
| 37 | } |
||
| 38 | |||
| 39 | return $menu; |
||
| 40 | } |
||
| 41 | } |
||
| 42 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.