@@ -35,7 +35,7 @@ |
||
35 | 35 | */ |
36 | 36 | public function make($name, $callback, $type = Builder::UL, $attributes = [], $activeAttributes = []) |
37 | 37 | { |
38 | - if(!is_callable($callback)) { |
|
38 | + if (!is_callable($callback)) { |
|
39 | 39 | throw new \InvalidArgumentException('Argument must be callable'); |
40 | 40 | } |
41 | 41 |
@@ -20,9 +20,9 @@ |
||
20 | 20 | public function canDisplay() |
21 | 21 | { |
22 | 22 | if (is_callable($this->rule)) { |
23 | - return (bool)call_user_func($this->rule); |
|
23 | + return (bool) call_user_func($this->rule); |
|
24 | 24 | } |
25 | 25 | |
26 | - return (bool)$this->rule; |
|
26 | + return (bool) $this->rule; |
|
27 | 27 | } |
28 | 28 | } |
29 | 29 | \ No newline at end of file |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | */ |
153 | 153 | public function setType($type) |
154 | 154 | { |
155 | - $this->type = (string)$type; |
|
155 | + $this->type = (string) $type; |
|
156 | 156 | } |
157 | 157 | |
158 | 158 | /** |
@@ -195,8 +195,8 @@ discard block |
||
195 | 195 | protected function minifyHtmlOutput($html) |
196 | 196 | { |
197 | 197 | $search = array( |
198 | - '/\>[^\S]+/s', // strip whitespaces after tags, except space |
|
199 | - '/[^\S]+\</s', // strip whitespaces before tags, except space |
|
198 | + '/\>[^\S]+/s', // strip whitespaces after tags, except space |
|
199 | + '/[^\S]+\</s', // strip whitespaces before tags, except space |
|
200 | 200 | '/(\s)+/s' // shorten multiple whitespace sequences |
201 | 201 | ); |
202 | 202 |
@@ -51,8 +51,7 @@ |
||
51 | 51 | public function buildAttributes($attributes = []) |
52 | 52 | { |
53 | 53 | $attributes = $this->isActive() ? |
54 | - (new MergeAttributes($this->builder->activeAttributes()->all(), $attributes))->merge() : |
|
55 | - $attributes; |
|
54 | + (new MergeAttributes($this->builder->activeAttributes()->all(), $attributes))->merge() : $attributes; |
|
56 | 55 | |
57 | 56 | return $this->attributes->build($attributes); |
58 | 57 | } |
@@ -63,7 +63,7 @@ |
||
63 | 63 | |
64 | 64 | protected function registerSingleton() |
65 | 65 | { |
66 | - $this->app->singleton('menu.instance', function (Container $app) { |
|
66 | + $this->app->singleton('menu.instance', function(Container $app) { |
|
67 | 67 | return new Menu($app); |
68 | 68 | }); |
69 | 69 | $this->app->alias(MenuContract::class, 'menu.instance'); |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | $builder = $this->builderFactory(); |
38 | 38 | |
39 | 39 | $item = $builder->add('index', 'Index', '/', ['class' => 'main-menu'], ['class' => 'link'], |
40 | - function (Item $item) { |
|
40 | + function(Item $item) { |
|
41 | 41 | $this->assertAttributeEquals('Index', 'title', $item->getLink()); |
42 | 42 | $item->getLink()->setTitle('Home'); |
43 | 43 | }); |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | |
102 | 102 | $this->assertInstanceOf(Attributes::class, $activeAttributes); |
103 | 103 | |
104 | - $result = $builder->activeAttributes(function (Attributes $attributes) { |
|
104 | + $result = $builder->activeAttributes(function(Attributes $attributes) { |
|
105 | 105 | $this->assertInstanceOf(Attributes::class, $attributes); |
106 | 106 | |
107 | 107 | return $attributes->get('class'); |
@@ -114,9 +114,9 @@ discard block |
||
114 | 114 | { |
115 | 115 | $builder = $this->builderFactory(); |
116 | 116 | |
117 | - $group = $builder->group('test', function (Item $item) use ($builder) { |
|
117 | + $group = $builder->group('test', function(Item $item) use ($builder) { |
|
118 | 118 | $this->assertAttributeEquals($builder, 'builder', $item); |
119 | - }, function (Builder $menu) use ($builder) { |
|
119 | + }, function(Builder $menu) use ($builder) { |
|
120 | 120 | $this->assertEquals($builder->activeAttributes()->all(), $menu->activeAttributes()->all()); |
121 | 121 | }); |
122 | 122 | |
@@ -130,18 +130,18 @@ discard block |
||
130 | 130 | $index = $builder->add('index', 'Index Page', url('/')); |
131 | 131 | $index->getLink()->getAttributes()->push(['class' => 'menu-link']); |
132 | 132 | |
133 | - $builder->group('orders', function (Item $item) { |
|
133 | + $builder->group('orders', function(Item $item) { |
|
134 | 134 | $item->getAttributes()->push(['class' => 'child-menu']); |
135 | 135 | |
136 | 136 | $link = $item->getLink(); |
137 | 137 | $link->setTitle('Orders'); |
138 | 138 | $link->setUrl('javascript:;'); |
139 | 139 | |
140 | - }, function (Builder $menu) { |
|
140 | + }, function(Builder $menu) { |
|
141 | 141 | $menu->add('all', 'All', url('/orders/all')); |
142 | 142 | $menu->add('type_1', 'Type 1', url('/orders/1'), [], ['class' => 'text-color-red']); |
143 | 143 | |
144 | - $menu->add('type_2', 'Type 2', url('/orders/2'), [], [], function (Item $item) { |
|
144 | + $menu->add('type_2', 'Type 2', url('/orders/2'), [], [], function(Item $item) { |
|
145 | 145 | $item->getLink()->getAttributes()->push(['data-attribute' => 'value']); |
146 | 146 | }); |
147 | 147 | }); |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | $builder = $this->builderFactory(); |
158 | 158 | |
159 | 159 | $builder->add('index', 'Index Page', url('/')); |
160 | - $builder->add('login', 'Login', url('/login'))->setDisplayRule(function () { |
|
160 | + $builder->add('login', 'Login', url('/login'))->setDisplayRule(function() { |
|
161 | 161 | return true; |
162 | 162 | }); |
163 | 163 | $builder->add('admin', 'Admin', url('/admin'))->setDisplayRule(false); |