@@ -352,7 +352,7 @@ |
||
352 | 352 | } |
353 | 353 | |
354 | 354 | /** |
355 | - * @param $element |
|
355 | + * @param string $element |
|
356 | 356 | * @return ElementFactory |
357 | 357 | * @throws \RuntimeException |
358 | 358 | */ |
@@ -92,7 +92,7 @@ |
||
92 | 92 | |
93 | 93 | $result = call_if_callable($callback, $factory); |
94 | 94 | |
95 | - if (! $result instanceof Element) { |
|
95 | + if (!$result instanceof Element) { |
|
96 | 96 | throw new \RuntimeException("Result of callback must be [" . Element::class . "]"); |
97 | 97 | } |
98 | 98 |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | |
83 | 83 | protected function registerRenderSystem() |
84 | 84 | { |
85 | - $this->app->bind('menu.render', function (Container $app) { |
|
85 | + $this->app->bind('menu.render', function(Container $app) { |
|
86 | 86 | $config = $app->make(Repository::class)->get('menu'); |
87 | 87 | $key = $config['default']; |
88 | 88 | $available = $config['renders']; |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | |
99 | 99 | protected function registerComparativeUrl() |
100 | 100 | { |
101 | - $this->app->singleton('menu.compare-url', function (Container $app) { |
|
101 | + $this->app->singleton('menu.compare-url', function(Container $app) { |
|
102 | 102 | return $app->make(ComparativeUrl::class, [ |
103 | 103 | 'skippedPaths' => $app->make(Repository::class)->get('menu.skippedPaths'), |
104 | 104 | ]); |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | |
109 | 109 | protected function registerFromArrayBuilder() |
110 | 110 | { |
111 | - $this->app->singleton('menu.from-array-builder', function (Container $app) { |
|
111 | + $this->app->singleton('menu.from-array-builder', function(Container $app) { |
|
112 | 112 | return $app->make(FromArrayBuilder::class); |
113 | 113 | }); |
114 | 114 | $this->app->alias('menu.from-array-builder', FromArrayBuilderContract::class); |
@@ -71,7 +71,7 @@ |
||
71 | 71 | foreach ($array['elements'] as $key => $element) { |
72 | 72 | $class = $aliases[$element['type']]; |
73 | 73 | |
74 | - $builder->create($key, $class, function (ElementFactory $factory) use ($class, $element) { |
|
74 | + $builder->create($key, $class, function(ElementFactory $factory) use ($class, $element) { |
|
75 | 75 | // If element is submenu |
76 | 76 | if ($this->isBuilder($class)) { |
77 | 77 | $element['builder'] = $this->build($element['builder']); |
@@ -144,11 +144,11 @@ discard block |
||
144 | 144 | |
145 | 145 | $builder = $this->builderFactory(); |
146 | 146 | |
147 | - $builder->create('index', Link::class, function (LinkFactory $factory) { |
|
147 | + $builder->create('index', Link::class, function(LinkFactory $factory) { |
|
148 | 148 | return $factory->build(); |
149 | 149 | }); |
150 | 150 | |
151 | - $builder->create('index', SubMenu::class, function (SubMenuFactory $factory) { |
|
151 | + $builder->create('index', SubMenu::class, function(SubMenuFactory $factory) { |
|
152 | 152 | return $factory->build(); |
153 | 153 | }); // Duplicate |
154 | 154 | } |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | { |
158 | 158 | $builder = $this->builderFactory(); |
159 | 159 | |
160 | - $item = $builder->create('test', Link::class, function (LinkFactory $factory) { |
|
160 | + $item = $builder->create('test', Link::class, function(LinkFactory $factory) { |
|
161 | 161 | return $factory->build(); |
162 | 162 | }); |
163 | 163 | |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | { |
172 | 172 | $builder = $this->builderFactory(); |
173 | 173 | |
174 | - $item = $builder->create('test', Link::class, function (LinkFactory $factory) { |
|
174 | + $item = $builder->create('test', Link::class, function(LinkFactory $factory) { |
|
175 | 175 | return $factory->build(); |
176 | 176 | }); |
177 | 177 | |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | |
205 | 205 | $this->assertEquals([], $builder->all()); |
206 | 206 | |
207 | - $item = $builder->create('test', Link::class, function (LinkFactory $factory) { |
|
207 | + $item = $builder->create('test', Link::class, function(LinkFactory $factory) { |
|
208 | 208 | return $factory->build(); |
209 | 209 | }); |
210 | 210 | |
@@ -215,10 +215,10 @@ discard block |
||
215 | 215 | { |
216 | 216 | $builder = $this->builderFactory(); |
217 | 217 | |
218 | - $builder->create('test', Link::class, function (LinkFactory $factory) { |
|
218 | + $builder->create('test', Link::class, function(LinkFactory $factory) { |
|
219 | 219 | return $factory->build(); |
220 | 220 | }); |
221 | - $builder->create('another', Text::class, function (TextFactory $factory) { |
|
221 | + $builder->create('another', Text::class, function(TextFactory $factory) { |
|
222 | 222 | return $factory->build(); |
223 | 223 | }); |
224 | 224 | |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | return $factory->build(); |
390 | 390 | }); |
391 | 391 | |
392 | - $builder->insertAfter('index', function (Builder $builder) { |
|
392 | + $builder->insertAfter('index', function(Builder $builder) { |
|
393 | 393 | $builder->create('users', Link::class, function(LinkFactory $factory) { |
394 | 394 | $factory->title = 'Users'; |
395 | 395 | $factory->url = url('users'); |
@@ -398,7 +398,7 @@ discard block |
||
398 | 398 | }); |
399 | 399 | }); |
400 | 400 | |
401 | - $builder->insertBefore('users', function (Builder $builder) { |
|
401 | + $builder->insertBefore('users', function(Builder $builder) { |
|
402 | 402 | $builder->create('profile', Link::class, function(LinkFactory $factory) { |
403 | 403 | $factory->title = 'Profile'; |
404 | 404 | $factory->url = url('profile'); |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | $this->expectException(\RuntimeException::class); |
416 | 416 | |
417 | 417 | $builder = $this->builderFactory(); |
418 | - $builder->insertBefore('not_exist', function (Builder $builder) {}); |
|
418 | + $builder->insertBefore('not_exist', function(Builder $builder) {}); |
|
419 | 419 | } |
420 | 420 | |
421 | 421 | public function testInsertExceptionDuplicate() |
@@ -438,7 +438,7 @@ discard block |
||
438 | 438 | return $factory->build(); |
439 | 439 | }); |
440 | 440 | |
441 | - $builder->insertAfter('home', function (Builder $builder) { |
|
441 | + $builder->insertAfter('home', function(Builder $builder) { |
|
442 | 442 | $builder->create('some', Text::class, function(TextFactory $factory) { |
443 | 443 | $factory->text = 'Duplicate some'; |
444 | 444 |