Completed
Push — master ( e9a84e...21be5c )
by Aleksandar
26:24
created
packages/Web/Factory/Action/VideosActionFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Web\Factory\Action;
6 6
 
Please login to merge, or discard this patch.
packages/Web/Factory/Action/HomeActionFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Web\Factory\Action;
6 6
 
Please login to merge, or discard this patch.
packages/Web/Factory/Action/VideoActionFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Web\Factory\Action;
6 6
 
Please login to merge, or discard this patch.
packages/Web/Factory/Action/EventsActionFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Web\Factory\Action;
6 6
 
Please login to merge, or discard this patch.
packages/Web/Factory/Action/CategoryActionFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Web\Factory\Action;
6 6
 
Please login to merge, or discard this patch.
packages/Menu/src/Service/MenuService.php 3 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -121,8 +121,7 @@
 block discarded – undo
121 121
             $orderNo = 1;
122 122
             $this->updateLevel(null, $menuOrder, $orderNo);
123 123
             $this->menuMapper->getAdapter()->getDriver()->getConnection()->commit();
124
-        }
125
-        catch(\Exception $e) {
124
+        } catch(\Exception $e) {
126 125
             $this->menuMapper->getAdapter()->getDriver()->getConnection()->rollback();
127 126
 
128 127
             throw $e;
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -163,7 +163,7 @@
 block discarded – undo
163 163
             $data['category_uuid'] = null;
164 164
         } elseif ($data['category_id']) {
165 165
             $category
166
-                                   = $this->categoryService->getCategory($data['category_id']);
166
+                                    = $this->categoryService->getCategory($data['category_id']);
167 167
             $data['category_uuid'] = $category->category_uuid;
168 168
             $data['page_uuid']     = null;
169 169
         } else {
Please login to merge, or discard this patch.
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -28,26 +28,26 @@  discard block
 block discarded – undo
28 28
     private function unflattenArray(array $flatArray)
29 29
     {
30 30
         $flatArray = array_reverse($flatArray);
31
-        $refs      = [];
32
-        $result    = [];
31
+        $refs      = [ ];
32
+        $result    = [ ];
33 33
 
34
-        while(count($flatArray) > 0) {
35
-            for($i = count($flatArray) - 1; $i >= 0; $i--) {
36
-                if(!isset($flatArray[$i]['children'])) {
37
-                    $flatArray[$i]['children'] = [];
34
+        while (count($flatArray) > 0) {
35
+            for ($i = count($flatArray) - 1; $i >= 0; $i--) {
36
+                if (!isset($flatArray[ $i ][ 'children' ])) {
37
+                    $flatArray[ $i ][ 'children' ] = [ ];
38 38
                 }
39 39
 
40
-                if(!$flatArray[$i]["parent_id"]) {
41
-                    $result[$flatArray[$i]["menu_id"]] = $flatArray[$i];
42
-                    $refs[$flatArray[$i]["menu_id"]]   = &$result[$flatArray[$i]["menu_id"]];
43
-                    unset($flatArray[$i]);
40
+                if (!$flatArray[ $i ][ "parent_id" ]) {
41
+                    $result[ $flatArray[ $i ][ "menu_id" ] ] = $flatArray[ $i ];
42
+                    $refs[ $flatArray[ $i ][ "menu_id" ] ]   = &$result[ $flatArray[ $i ][ "menu_id" ] ];
43
+                    unset($flatArray[ $i ]);
44 44
                     $flatArray = array_values($flatArray);
45
-                } else if($flatArray[$i]["parent_id"] != 0) {
46
-                    if(array_key_exists($flatArray[$i]["parent_id"], $refs)) {
47
-                        $o                                               = $flatArray[$i];
48
-                        $refs[$flatArray[$i]["menu_id"]]                 = $o;
49
-                        $refs[$flatArray[$i]["parent_id"]]["children"][] = &$refs[$flatArray[$i]["menu_id"]];
50
-                        unset($flatArray[$i]);
45
+                } else if ($flatArray[ $i ][ "parent_id" ] != 0) {
46
+                    if (array_key_exists($flatArray[ $i ][ "parent_id" ], $refs)) {
47
+                        $o                                               = $flatArray[ $i ];
48
+                        $refs[ $flatArray[ $i ][ "menu_id" ] ]                 = $o;
49
+                        $refs[ $flatArray[ $i ][ "parent_id" ] ][ "children" ][ ] = &$refs[ $flatArray[ $i ][ "menu_id" ] ];
50
+                        unset($flatArray[ $i ]);
51 51
                         $flatArray = array_values($flatArray);
52 52
                     }
53 53
                 }
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
         $this->pageService     = $pageService;
66 66
     }
67 67
 
68
-    public function getNestedAll($isActive = null, $filter = [])
68
+    public function getNestedAll($isActive = null, $filter = [ ])
69 69
     {
70 70
         $items = $this->menuMapper->selectAll($isActive, $filter)->toArray();
71 71
 
@@ -81,8 +81,8 @@  discard block
 block discarded – undo
81 81
     {
82 82
         $data = $this->filterMenuItem($data);
83 83
 
84
-        $data['menu_id']   = Uuid::uuid1()->toString();
85
-        $data['menu_uuid'] = (new MysqlUuid($data['menu_id']))->toFormat(new Binary);
84
+        $data[ 'menu_id' ]   = Uuid::uuid1()->toString();
85
+        $data[ 'menu_uuid' ] = (new MysqlUuid($data[ 'menu_id' ]))->toFormat(new Binary);
86 86
 
87 87
         return $this->menuMapper->insertMenuItem($data);
88 88
     }
@@ -96,13 +96,13 @@  discard block
 block discarded – undo
96 96
 
97 97
     public function delete($id)
98 98
     {
99
-        $children = $this->menuMapper->select(['parent_id' => $id]);
99
+        $children = $this->menuMapper->select([ 'parent_id' => $id ]);
100 100
 
101
-        if($children->count()) {
101
+        if ($children->count()) {
102 102
             throw new \Exception('This Menu Item has child items', 400);
103 103
         }
104 104
 
105
-        return $this->menuMapper->delete(['menu_id' => $id]);
105
+        return $this->menuMapper->delete([ 'menu_id' => $id ]);
106 106
     }
107 107
 
108 108
     public function getForSelect()
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 
113 113
     public function updateMenuOrder($menuOrder)
114 114
     {
115
-        if(!$menuOrder) {
115
+        if (!$menuOrder) {
116 116
             return true;
117 117
         }
118 118
 
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
             $this->updateLevel(null, $menuOrder, $orderNo);
123 123
             $this->menuMapper->getAdapter()->getDriver()->getConnection()->commit();
124 124
         }
125
-        catch(\Exception $e) {
125
+        catch (\Exception $e) {
126 126
             $this->menuMapper->getAdapter()->getDriver()->getConnection()->rollback();
127 127
 
128 128
             throw $e;
@@ -133,12 +133,12 @@  discard block
 block discarded – undo
133 133
 
134 134
     private function updateLevel($parentId = null, $children, &$orderNo)
135 135
     {
136
-        foreach($children as $v) {
137
-            if(isset($v->children)) {
138
-                $this->menuMapper->update(['order_no' => $orderNo++, 'parent_id' => $parentId], ['menu_id' => $v->id]);
136
+        foreach ($children as $v) {
137
+            if (isset($v->children)) {
138
+                $this->menuMapper->update([ 'order_no' => $orderNo++, 'parent_id' => $parentId ], [ 'menu_id' => $v->id ]);
139 139
                 $this->updateLevel($v->id, $v->children, $orderNo);
140 140
             } else {
141
-                $this->menuMapper->update(['order_no' => $orderNo++, 'parent_id' => $parentId], ['menu_id' => $v->id]);
141
+                $this->menuMapper->update([ 'order_no' => $orderNo++, 'parent_id' => $parentId ], [ 'menu_id' => $v->id ]);
142 142
             }
143 143
         }
144 144
     }
@@ -147,31 +147,31 @@  discard block
 block discarded – undo
147 147
     {
148 148
         $filter = $this->menuFilter->getInputFilter()->setData($data);
149 149
 
150
-        if(!$filter->isValid()) {
150
+        if (!$filter->isValid()) {
151 151
             throw new FilterException($filter->getMessages());
152 152
         }
153 153
 
154
-        if(count(array_filter([$data['page_id'], $data['category_id'], $data['href']])) > 1) {
154
+        if (count(array_filter([ $data[ 'page_id' ], $data[ 'category_id' ], $data[ 'href' ] ])) > 1) {
155 155
             throw new \Exception('You need to set only one link. Post, Category or Href.');
156 156
         }
157 157
 
158 158
         $data = $filter->getValues();
159 159
 
160
-        if ($data['page_id']) {
161
-            $page                  = $this->pageService->getPage($data['page_id']);
162
-            $data['page_uuid']     = $page->getPageUuid();
163
-            $data['category_uuid'] = null;
164
-        } elseif ($data['category_id']) {
160
+        if ($data[ 'page_id' ]) {
161
+            $page                  = $this->pageService->getPage($data[ 'page_id' ]);
162
+            $data[ 'page_uuid' ]     = $page->getPageUuid();
163
+            $data[ 'category_uuid' ] = null;
164
+        } elseif ($data[ 'category_id' ]) {
165 165
             $category
166
-                                   = $this->categoryService->getCategory($data['category_id']);
167
-            $data['category_uuid'] = $category->category_uuid;
168
-            $data['page_uuid']     = null;
166
+                                   = $this->categoryService->getCategory($data[ 'category_id' ]);
167
+            $data[ 'category_uuid' ] = $category->category_uuid;
168
+            $data[ 'page_uuid' ]     = null;
169 169
         } else {
170
-            $data['page_uuid']     = null;
171
-            $data['category_uuid'] = null;
170
+            $data[ 'page_uuid' ]     = null;
171
+            $data[ 'category_uuid' ] = null;
172 172
         }
173 173
 
174
-        unset($data['page_id'], $data['category_id']);
174
+        unset($data[ 'page_id' ], $data[ 'category_id' ]);
175 175
 
176 176
         return $data;
177 177
     }
Please login to merge, or discard this patch.
packages/Menu/src/ConfigProvider.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
                     'partial/menu-level' => __DIR__ . '/../templates/partial/menu-level.phtml',
13 13
                 ],
14 14
                 'paths' => [
15
-                    'menu' => [__DIR__ . '/../templates/menu'],
15
+                    'menu' => [ __DIR__ . '/../templates/menu' ],
16 16
                 ],
17 17
             ],
18 18
 
@@ -33,13 +33,13 @@  discard block
 block discarded – undo
33 33
                     'name'            => 'admin.menu',
34 34
                     'path'            => '/admin/menu',
35 35
                     'middleware'      => Controller\IndexController::class,
36
-                    'allowed_methods' => ['GET'],
36
+                    'allowed_methods' => [ 'GET' ],
37 37
                 ],
38 38
                 [
39 39
                     'name'            => 'admin.menu.action',
40 40
                     'path'            => '/admin/menu/:action/:id',
41 41
                     'middleware'      => Controller\IndexController::class,
42
-                    'allowed_methods' => ['GET', 'POST'],
42
+                    'allowed_methods' => [ 'GET', 'POST' ],
43 43
                 ],
44 44
             ],
45 45
 
Please login to merge, or discard this patch.
packages/Page/src/Controller/PageController.php 2 patches
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -75,17 +75,14 @@  discard block
 block discarded – undo
75 75
 
76 76
             if($pageId) {
77 77
                 $this->pageService->updatePage($data, $pageId);
78
-            }
79
-            else {
78
+            } else {
80 79
                 $this->pageService->createPage($data);
81 80
             }
82 81
 
83 82
             return $this->response->withStatus(302)->withHeader('Location', $this->router->generateUri('admin.pages'));
84
-        }
85
-        catch(FilterException $fe) {
83
+        } catch(FilterException $fe) {
86 84
             return $this->edit($fe->getArrayMessages());
87
-        }
88
-        catch(\Exception $e) {
85
+        } catch(\Exception $e) {
89 86
             throw $e;
90 87
         }
91 88
     }
@@ -97,8 +94,7 @@  discard block
 block discarded – undo
97 94
             $this->pageService->delete($pageId);
98 95
 
99 96
             return $this->response->withStatus(302)->withHeader('Location', $this->router->generateUri('admin.pages'));
100
-        }
101
-        catch(\Exception $e) {
97
+        } catch(\Exception $e) {
102 98
             return $this->response->withStatus(302)->withHeader('Location', $this->router->generateUri('admin.pages'));
103 99
         }
104 100
     }
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -55,8 +55,8 @@  discard block
 block discarded – undo
55 55
     public function index(): HtmlResponse
56 56
     {
57 57
         $params     = $this->request->getQueryParams();
58
-        $page       = isset($params['page']) ? $params['page'] : 1;
59
-        $limit      = isset($params['limit']) ? $params['limit'] : 15;
58
+        $page       = isset($params[ 'page' ]) ? $params[ 'page' ] : 1;
59
+        $limit      = isset($params[ 'limit' ]) ? $params[ 'limit' ] : 15;
60 60
         $pagination = $this->pageService->getPagination($page, $limit);
61 61
 
62 62
         return new HtmlResponse(
@@ -69,14 +69,14 @@  discard block
 block discarded – undo
69 69
         );
70 70
     }
71 71
 
72
-    public function edit($errors = []): HtmlResponse
72
+    public function edit($errors = [ ]): HtmlResponse
73 73
     {
74 74
         $id   = $this->request->getAttribute('id');
75 75
         $page = $this->pageService->getPage($id);
76 76
 
77
-        if($this->request->getParsedBody()) {
77
+        if ($this->request->getParsedBody()) {
78 78
             $page = new \Page\Entity\Page();
79
-            $page->exchangeArray($this->request->getParsedBody() + (array)$page);
79
+            $page->exchangeArray($this->request->getParsedBody() + (array) $page);
80 80
         }
81 81
 
82 82
         return new HtmlResponse(
@@ -95,9 +95,9 @@  discard block
 block discarded – undo
95 95
         try {
96 96
             $pageId = $this->request->getAttribute('id');
97 97
             $data   = $this->request->getParsedBody();
98
-            $data   += (new Request())->getFiles()->toArray();
98
+            $data += (new Request())->getFiles()->toArray();
99 99
 
100
-            if($pageId) {
100
+            if ($pageId) {
101 101
                 $this->pageService->updatePage($data, $pageId);
102 102
             }
103 103
             else {
@@ -106,10 +106,10 @@  discard block
 block discarded – undo
106 106
 
107 107
             return $this->response->withStatus(302)->withHeader('Location', $this->router->generateUri('admin.pages'));
108 108
         }
109
-        catch(FilterException $fe) {
109
+        catch (FilterException $fe) {
110 110
             return $this->edit($fe->getArrayMessages());
111 111
         }
112
-        catch(\Exception $e) {
112
+        catch (\Exception $e) {
113 113
             throw $e;
114 114
         }
115 115
     }
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 
123 123
             return $this->response->withStatus(302)->withHeader('Location', $this->router->generateUri('admin.pages'));
124 124
         }
125
-        catch(\Exception $e) {
125
+        catch (\Exception $e) {
126 126
             return $this->response->withStatus(302)->withHeader('Location', $this->router->generateUri('admin.pages'));
127 127
         }
128 128
     }
Please login to merge, or discard this patch.
packages/Page/templates/partial/pagination.php 2 patches
Braces   +15 added lines, -6 removed lines patch added patch discarded remove patch
@@ -17,13 +17,16 @@  discard block
 block discarded – undo
17 17
                                 <span class="glyphicon glyphicon-chevron-left"></span>
18 18
                             </a>
19 19
                         </li>
20
-                    <?php else: ?>
20
+                    <?php else {
21
+    : ?>
21 22
                         <li class="disabled">
22 23
                             <a href="#">
23 24
                                 <span class="glyphicon glyphicon-chevron-left"></span>
24 25
                             </a>
25 26
                         </li>
26
-                    <?php endif; ?>
27
+                    <?php endif;
28
+}
29
+?>
27 30
 
28 31
                     <!-- Numbered page links -->
29 32
                     <?php foreach($this->pagesInRange as $page): ?>
@@ -33,9 +36,12 @@  discard block
 block discarded – undo
33 36
                                     <?php echo $page; ?>
34 37
                                 </a>
35 38
                             </li>
36
-                        <?php else: ?>
39
+                        <?php else {
40
+    : ?>
37 41
                             <li class="active">
38
-                                <a href="#"><?php echo $page; ?></a>
42
+                                <a href="#"><?php echo $page;
43
+}
44
+?></a>
39 45
                             </li>
40 46
                         <?php endif; ?>
41 47
                     <?php endforeach; ?>
@@ -47,13 +53,16 @@  discard block
 block discarded – undo
47 53
                                 <span class="glyphicon glyphicon-chevron-right"></span>
48 54
                             </a>
49 55
                         </li>
50
-                    <?php else: ?>
56
+                    <?php else {
57
+    : ?>
51 58
                         <li class="disabled">
52 59
                             <a href="#">
53 60
                                 <span class="glyphicon glyphicon-chevron-right"></span>
54 61
                             </a>
55 62
                         </li>
56
-                    <?php endif; ?>
63
+                    <?php endif;
64
+}
65
+?>
57 66
                 </ul>
58 67
             </div>
59 68
         <?php endif; ?>
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -7,13 +7,13 @@  discard block
 block discarded – undo
7 7
         </div>
8 8
     </div>
9 9
     <div class="col-sm-7">
10
-        <?php if($this->pageCount > 1) : ?>
10
+        <?php if ($this->pageCount > 1) : ?>
11 11
             <div class="pull-right">
12 12
                 <ul class="pagination" style="margin:0px;">
13 13
                     <!-- Previous page link -->
14
-                    <?php if(isset($this->previous)) : ?>
14
+                    <?php if (isset($this->previous)) : ?>
15 15
                         <li>
16
-                            <a href="<?php echo $this->url($this->route, isset($this->data) ? $this->data : []); ?>?page=<?php echo $this->previous; ?>">
16
+                            <a href="<?php echo $this->url($this->route, isset($this->data) ? $this->data : [ ]); ?>?page=<?php echo $this->previous; ?>">
17 17
                                 <span class="glyphicon glyphicon-chevron-left"></span>
18 18
                             </a>
19 19
                         </li>
@@ -26,10 +26,10 @@  discard block
 block discarded – undo
26 26
                     <?php endif; ?>
27 27
 
28 28
                     <!-- Numbered page links -->
29
-                    <?php foreach($this->pagesInRange as $page): ?>
30
-                        <?php if($page != $this->current) : ?>
29
+                    <?php foreach ($this->pagesInRange as $page): ?>
30
+                        <?php if ($page != $this->current) : ?>
31 31
                             <li>
32
-                                <a href="<?php echo $this->url($this->route, isset($this->data) ? $this->data : []); ?>?page=<?php echo $page; ?>">
32
+                                <a href="<?php echo $this->url($this->route, isset($this->data) ? $this->data : [ ]); ?>?page=<?php echo $page; ?>">
33 33
                                     <?php echo $page; ?>
34 34
                                 </a>
35 35
                             </li>
@@ -41,9 +41,9 @@  discard block
 block discarded – undo
41 41
                     <?php endforeach; ?>
42 42
 
43 43
                     <!-- Next page link -->
44
-                    <?php if(isset($this->next)) : ?>
44
+                    <?php if (isset($this->next)) : ?>
45 45
                         <li>
46
-                            <a href="<?php echo $this->url($this->route, isset($this->data) ? $this->data : []); ?>?page=<?php echo $this->next; ?>">
46
+                            <a href="<?php echo $this->url($this->route, isset($this->data) ? $this->data : [ ]); ?>?page=<?php echo $this->next; ?>">
47 47
                                 <span class="glyphicon glyphicon-chevron-right"></span>
48 48
                             </a>
49 49
                         </li>
Please login to merge, or discard this patch.