Completed
Push — master ( 7cecbb...791ec7 )
by Oleg
07:00
created
src/Contracts/Builder.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
      * @param string $view
23 23
      */
24 24
     function __construct(Container $container, $name, Attributes $attributes, 
25
-                         Attributes $activeAttributes, $type = self::UL, $view = null);
25
+                            Attributes $activeAttributes, $type = self::UL, $view = null);
26 26
 
27 27
     /**
28 28
      * Make sub menu
Please login to merge, or discard this patch.
tests/stub/another.php 2 patches
Braces   +10 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,13 +3,21 @@
 block discarded – undo
3 3
         <<?=$menu->getType() . $menu->buildAttributes();?>>
4 4
             <?php foreach ($menu->all() as $element) :?>
5 5
                 <?php $isGroup = $element instanceof \Malezha\Menu\Contracts\Group;?>
6
-                <?php if ($isGroup) $item = $element->getItem(); else $item = $element;?>
6
+                <?php if ($isGroup) {
7
+    $item = $element->getItem();
8
+} else {
9
+    $item = $element;
10
+}
11
+?>
7 12
                 <?php if ($item->canDisplay()) :?>
8 13
                     <li<?=$item->buildAttributes();?>>
9 14
                         <a href="<?=$item->getLink()->getUrl();?>"<?=$item->getLink()->buildAttributes();?>>
10 15
                             <?=$item->getLink()->getTitle();?>
11 16
                         </a>
12
-                        <?php if ($isGroup) echo $element->getMenu()->render($renderView);?>
17
+                        <?php if ($isGroup) {
18
+    echo $element->getMenu()->render($renderView);
19
+}
20
+?>
13 21
                     </li>
14 22
                 <?php endif;?>
15 23
             <?php endforeach;?>
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,18 +1,18 @@
 block discarded – undo
1 1
 <div class="div-menu">
2 2
     <?php if ($menu) :?>
3
-        <<?=$menu->getType() . $menu->buildAttributes();?>>
3
+        <<?=$menu->getType() . $menu->buildAttributes(); ?>>
4 4
             <?php foreach ($menu->all() as $element) :?>
5
-                <?php $isGroup = $element instanceof \Malezha\Menu\Contracts\SubMenu;?>
6
-                <?php if ($isGroup) $item = $element->getItem(); else $item = $element;?>
5
+                <?php $isGroup = $element instanceof \Malezha\Menu\Contracts\SubMenu; ?>
6
+                <?php if ($isGroup) $item = $element->getItem(); else $item = $element; ?>
7 7
                 <?php if ($item->canDisplay()) :?>
8
-                    <li<?=$item->buildAttributes();?>>
9
-                        <a href="<?=$item->getLink()->getUrl();?>"<?=$item->getLink()->buildAttributes();?>>
10
-                            <?=$item->getLink()->getTitle();?>
8
+                    <li<?=$item->buildAttributes(); ?>>
9
+                        <a href="<?=$item->getLink()->getUrl(); ?>"<?=$item->getLink()->buildAttributes(); ?>>
10
+                            <?=$item->getLink()->getTitle(); ?>
11 11
                         </a>
12
-                        <?php if ($isGroup) echo $element->getMenu()->render($renderView);?>
12
+                        <?php if ($isGroup) echo $element->getMenu()->render($renderView); ?>
13 13
                     </li>
14
-                <?php endif;?>
15
-            <?php endforeach;?>
16
-        </<?=$menu->getType();?>>
17
-    <?php endif;?>
14
+                <?php endif; ?>
15
+            <?php endforeach; ?>
16
+        </<?=$menu->getType(); ?>>
17
+    <?php endif; ?>
18 18
 </div>
19 19
\ No newline at end of file
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
@@ -103,7 +103,7 @@
 block discarded – undo
103 103
 
104 104
     protected function registerRenderSystem()
105 105
     {
106
-        $this->app->bind('menu.render', function (Container $app) {
106
+        $this->app->bind('menu.render', function(Container $app) {
107 107
             $config = $app['config']->get('menu');
108 108
             $key = $config['template-system'];
109 109
             $available = $config['available-template-systems'];
Please login to merge, or discard this patch.
views/view.php 2 patches
Braces   +10 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,13 +2,21 @@
 block discarded – undo
2 2
     <<?=$menu->getType() . $menu->buildAttributes();?>>
3 3
         <?php foreach ($menu->all() as $element) :?>
4 4
             <?php $isGroup = $element instanceof \Malezha\Menu\Contracts\Group;?>
5
-            <?php if ($isGroup) $item = $element->getItem(); else $item = $element;?>
5
+            <?php if ($isGroup) {
6
+    $item = $element->getItem();
7
+} else {
8
+    $item = $element;
9
+}
10
+?>
6 11
             <?php if ($item->canDisplay()) :?>
7 12
                 <li<?=$item->buildAttributes();?>>
8 13
                     <a href="<?=$item->getLink()->getUrl();?>"<?=$item->getLink()->buildAttributes();?>>
9 14
                         <?=$item->getLink()->getTitle();?>
10 15
                     </a>
11
-                    <?php if ($isGroup) echo $element->getMenu()->render($renderView);?>
16
+                    <?php if ($isGroup) {
17
+    echo $element->getMenu()->render($renderView);
18
+}
19
+?>
12 20
                 </li>
13 21
             <?php endif;?>
14 22
         <?php endforeach;?>
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@
 block discarded – undo
1 1
 <?php if ($menu) :?>
2
-    <<?=$menu->getType() . $menu->buildAttributes();?>>
2
+    <<?=$menu->getType() . $menu->buildAttributes(); ?>>
3 3
         <?php foreach ($menu->all() as $element) :?>
4
-            <?php $isGroup = $element instanceof \Malezha\Menu\Contracts\SubMenu;?>
5
-            <?php if ($isGroup) $item = $element->getItem(); else $item = $element;?>
4
+            <?php $isGroup = $element instanceof \Malezha\Menu\Contracts\SubMenu; ?>
5
+            <?php if ($isGroup) $item = $element->getItem(); else $item = $element; ?>
6 6
             <?php if ($item->canDisplay()) :?>
7
-                <li<?=$item->buildAttributes();?>>
8
-                    <a href="<?=$item->getLink()->getUrl();?>"<?=$item->getLink()->buildAttributes();?>>
9
-                        <?=$item->getLink()->getTitle();?>
7
+                <li<?=$item->buildAttributes(); ?>>
8
+                    <a href="<?=$item->getLink()->getUrl(); ?>"<?=$item->getLink()->buildAttributes(); ?>>
9
+                        <?=$item->getLink()->getTitle(); ?>
10 10
                     </a>
11
-                    <?php if ($isGroup) echo $element->getMenu()->render($renderView);?>
11
+                    <?php if ($isGroup) echo $element->getMenu()->render($renderView); ?>
12 12
                 </li>
13
-            <?php endif;?>
14
-        <?php endforeach;?>
15
-    </<?=$menu->getType();?>>
16
-<?php endif;?>
17 13
\ No newline at end of file
14
+            <?php endif; ?>
15
+        <?php endforeach; ?>
16
+    </<?=$menu->getType(); ?>>
17
+<?php endif; ?>
18 18
\ No newline at end of file
Please login to merge, or discard this patch.
src/Entity/Builder.php 1 patch
Unused Use Statements   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,11 +6,10 @@
 block discarded – undo
6 6
 use Illuminate\Http\Request;
7 7
 use Malezha\Menu\Contracts\Attributes as AttributesContract;
8 8
 use Malezha\Menu\Contracts\Builder as BuilderContract;
9
-use Malezha\Menu\Contracts\SubMenu as GroupContract;
9
+use Malezha\Menu\Contracts\SubMenu as SubMenuContract;
10 10
 use Malezha\Menu\Contracts\Item as ItemContract;
11 11
 use Malezha\Menu\Contracts\Link as LinkContract;
12 12
 use Malezha\Menu\Contracts\MenuRender;
13
-use Malezha\Menu\Contracts\SubMenu as SubMenuContract;
14 13
 use Malezha\Menu\Traits\HasAttributes;
15 14
 
16 15
 /**
Please login to merge, or discard this patch.
tests/BuilderTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
         
201 201
         $builder = $this->builderFactory();
202 202
         $builder->create('index', 'Index Page', url('/'));
203
-        $builder->submenu('group', function(Item $item){}, function(Builder $menu) {
203
+        $builder->submenu('group', function(Item $item) {}, function(Builder $menu) {
204 204
             $menu->create('one', 'One', url('/one'));
205 205
         });
206 206
 
@@ -226,11 +226,11 @@  discard block
 block discarded – undo
226 226
         $builder->create('index', 'Index Page', url('/'));
227 227
         $builder->create('logout', 'logout', url('logout'));
228 228
         
229
-        $builder->insertAfter('index', function (Builder $builder) {
229
+        $builder->insertAfter('index', function(Builder $builder) {
230 230
             $builder->create('users', 'Users', url('users'));
231 231
         });
232 232
         
233
-        $builder->insertBefore('users', function (Builder $builder) {
233
+        $builder->insertBefore('users', function(Builder $builder) {
234 234
             $builder->create('profile', 'Profile', url('profile'));
235 235
         });
236 236
 
Please login to merge, or discard this patch.