Completed
Push — master ( 363ead...e52e2c )
by Oleg
06:33
created
src/Entity/Builder.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -227,7 +227,7 @@
 block discarded – undo
227 227
     }
228 228
 
229 229
     /**
230
-     * @param $html
230
+     * @param string $html
231 231
      * @return mixed
232 232
      */
233 233
     protected function minifyHtmlOutput($html)
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,6 @@
 block discarded – undo
7 7
 use Malezha\Menu\Contracts\Attributes as AttributesContract;
8 8
 use Malezha\Menu\Contracts\Builder as BuilderContract;
9 9
 use Malezha\Menu\Contracts\Group;
10
-use Malezha\Menu\Contracts\HasAttributes as HasAttributesContract;
11 10
 use Malezha\Menu\Contracts\Item;
12 11
 use Malezha\Menu\Contracts\Link;
13 12
 use Malezha\Menu\Traits\HasAttributes;
Please login to merge, or discard this patch.
src/MenuServiceProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@
 block discarded – undo
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');
Please login to merge, or discard this patch.
tests/BuilderTest.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.
views/view.blade.php 1 patch
Braces   +6 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,12 @@
 block discarded – undo
1 1
 @if ($menu)
2 2
     <{{ $menu->getType() }}{!! $menu->buildAttributes() !!}>
3 3
     @foreach ($menu->all() as $value)
4
-        <?php $isGroup = $value instanceof \Malezha\Menu\Contracts\Group; if ($isGroup) $item = $value->getItem(); else $item = $value; ?>
4
+        <?php $isGroup = $value instanceof \Malezha\Menu\Contracts\Group; if ($isGroup) {
5
+    $item = $value->getItem();
6
+} else {
7
+    $item = $value;
8
+}
9
+?>
5 10
         @if($item->canDisplay())
6 11
         <li{!! $item->buildAttributes() !!}>
7 12
             <a href="{{ $item->getLink()->getUrl() }}"{!! $item->getLink()->buildAttributes() !!}>{!! $item->getLink()->getTitle() !!}</a>
Please login to merge, or discard this patch.