@@ -34,9 +34,10 @@ |
||
| 34 | 34 | */ |
| 35 | 35 | private function append_iterators(...$iterators): iterable |
| 36 | 36 | { |
| 37 | - foreach ($iterators as $iterator) |
|
| 38 | - foreach ($iterator as $row) |
|
| 37 | + foreach ($iterators as $iterator) { |
|
| 38 | + foreach ($iterator as $row) |
|
| 39 | 39 | yield ($row); |
| 40 | + } |
|
| 40 | 41 | } |
| 41 | 42 | |
| 42 | 43 | } |
| 43 | 44 | \ No newline at end of file |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | |
| 36 | 36 | $uri = $this->generator->generate($item->getRouteName(), $item->getRouteParameters()); |
| 37 | 37 | |
| 38 | - if ($uri === $this->requestStack->getCurrentRequest()?->getPathInfo()) { |
|
| 38 | + if ($uri === $this->requestStack->getCurrentRequest() ? ->getPathInfo()) { |
|
| 39 | 39 | $item->setCurrent(true); |
| 40 | 40 | return true; |
| 41 | 41 | } |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | public function test_event_triggers() |
| 15 | 15 | { |
| 16 | 16 | $menuService = $this->kernel->getContainer()->get(Menu::class); |
| 17 | - $results = $menuService->getMenuResult([],'test_event_menu'); |
|
| 17 | + $results = $menuService->getMenuResult([], 'test_event_menu'); |
|
| 18 | 18 | $this->assertSame(3, count($results)); |
| 19 | 19 | |
| 20 | 20 | $this->assertSame('Prepended Item', $results[0]->getLabel()); |
@@ -12,15 +12,15 @@ |
||
| 12 | 12 | { |
| 13 | 13 | yield MenuItem::system('System', 'test', [], 'images/svg/system.svg') |
| 14 | 14 | ->setRouteParameter('name', 'test_menu') |
| 15 | - ->setChildren(function () { |
|
| 16 | - yield MenuItem::section('Section', 'test_one', [], 'images/svg/thunder.svg')->setChildren(function () { |
|
| 15 | + ->setChildren(function() { |
|
| 16 | + yield MenuItem::section('Section', 'test_one', [], 'images/svg/thunder.svg')->setChildren(function() { |
|
| 17 | 17 | yield MenuItem::linkToRoute('Site', 'test_two', [], '@Menu/svg/default_folder.svg'); |
| 18 | 18 | yield MenuItem::linkToRoute('Dashboard', 'test_three'); |
| 19 | 19 | }); |
| 20 | 20 | }); |
| 21 | 21 | |
| 22 | - yield MenuItem::system('System', 'test', ['name' => 'test_menu'], 'images/svg/system.svg')->setChildren(function () { |
|
| 23 | - yield MenuItem::section('Section', 'test_one', [], 'images/svg/thunder.svg')->setChildren(function () { |
|
| 22 | + yield MenuItem::system('System', 'test', ['name' => 'test_menu'], 'images/svg/system.svg')->setChildren(function() { |
|
| 23 | + yield MenuItem::section('Section', 'test_one', [], 'images/svg/thunder.svg')->setChildren(function() { |
|
| 24 | 24 | yield MenuItem::linkToRoute('Site', 'test_two', [], '@Menu/svg/default_folder.svg'); |
| 25 | 25 | yield MenuItem::linkToRoute('Dashboard', 'test_three'); |
| 26 | 26 | }); |
@@ -23,11 +23,11 @@ |
||
| 23 | 23 | public function define(): Traversable |
| 24 | 24 | { |
| 25 | 25 | |
| 26 | - $items = function () { |
|
| 26 | + $items = function() { |
|
| 27 | 27 | yield MenuItem::system('System', 'test', [], 'images/svg/system.svg') |
| 28 | 28 | ->setRouteParameter('name', 'test_menu') |
| 29 | - ->setChildren(function () { |
|
| 30 | - yield MenuItem::section('Section', 'test_one', [], 'images/svg/thunder.svg')->setChildren(function () { |
|
| 29 | + ->setChildren(function() { |
|
| 30 | + yield MenuItem::section('Section', 'test_one', [], 'images/svg/thunder.svg')->setChildren(function() { |
|
| 31 | 31 | yield MenuItem::linkToRoute('Site', 'test_two', [], '@Menu/svg/default_folder.svg'); |
| 32 | 32 | yield MenuItem::linkToRoute('Dashboard', 'test_three'); |
| 33 | 33 | }); |
@@ -20,11 +20,11 @@ |
||
| 20 | 20 | public function addTestItems(MenuEvent $event) |
| 21 | 21 | { |
| 22 | 22 | $event->prepend(function () { |
| 23 | - yield MenuItem::system('Prepended Item', 'test') ->setRouteParameter('name', 'test_menu'); |
|
| 23 | + yield MenuItem::system('Prepended Item', 'test') ->setRouteParameter('name', 'test_menu'); |
|
| 24 | 24 | }); |
| 25 | 25 | |
| 26 | 26 | $event->append(function () { |
| 27 | - yield MenuItem::system('Appended Item', 'test') ->setRouteParameter('name', 'test_menu'); |
|
| 27 | + yield MenuItem::system('Appended Item', 'test') ->setRouteParameter('name', 'test_menu'); |
|
| 28 | 28 | }); |
| 29 | 29 | } |
| 30 | 30 | } |
| 31 | 31 | \ No newline at end of file |
@@ -19,11 +19,11 @@ |
||
| 19 | 19 | |
| 20 | 20 | public function addTestItems(MenuEvent $event) |
| 21 | 21 | { |
| 22 | - $event->prepend(function () { |
|
| 22 | + $event->prepend(function() { |
|
| 23 | 23 | yield MenuItem::system('Prepended Item', 'test') ->setRouteParameter('name', 'test_menu'); |
| 24 | 24 | }); |
| 25 | 25 | |
| 26 | - $event->append(function () { |
|
| 26 | + $event->append(function() { |
|
| 27 | 27 | yield MenuItem::system('Appended Item', 'test') ->setRouteParameter('name', 'test_menu'); |
| 28 | 28 | }); |
| 29 | 29 | } |