Format code

This commit is contained in:
Marco Petersen
2018-09-12 23:25:22 +03:00
parent 60119c5b1b
commit f1b9ffd160
40 changed files with 257 additions and 301 deletions

View File

@@ -1,4 +1,5 @@
<?php
// src/Menu/Menu.php
namespace App\Menu;
@@ -11,36 +12,35 @@ use Symfony\Component\HttpFoundation\RequestStack;
class Menu
{
/**
* @var EventDispatcherInterface
*/
private $dispatcher;
/**
* @var FactoryInterface
*/
private $factory;
public function __construct(FactoryInterface $factory, EventDispatcherInterface $dispatcher)
{
$this->dispatcher = $dispatcher;
$this->factory = $factory;
}
public function userTopbar(RequestStack $request): ItemInterface
{
$menu = $this->factory->createItem('root', array(
'childrenAttributes' => array(
'class' => 'navbar-nav mr-auto',
),
));
$menu = $this->factory->createItem('root', [
'childrenAttributes' => [
'class' => 'navbar-nav mr-auto',
],
]);
$this->dispatcher->dispatch(
UserMenuEvent::EVENT,
new UserMenuEvent($this->factory, $menu, $request)
);
return $menu;
}
}
}
}