Completed
Pull Request — master (#3788)
by Craig
01:31
created
src/system/BlocksModule/Controller/PositionController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@
 block discarded – undo
85 85
      */
86 86
     public function deleteAction(Request $request, BlockPositionEntity $positionEntity)
87 87
     {
88
-        if (!$this->hasPermission('ZikulaBlocksModule::position', $positionEntity->getName() .'::'. $positionEntity->getPid(), ACCESS_DELETE)) {
88
+        if (!$this->hasPermission('ZikulaBlocksModule::position', $positionEntity->getName() . '::' . $positionEntity->getPid(), ACCESS_DELETE)) {
89 89
             throw new AccessDeniedException();
90 90
         }
91 91
 
Please login to merge, or discard this patch.
src/system/BlocksModule/Helper/InstallerHelper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@
 block discarded – undo
82 82
             $blockClassName = preg_match('/.*Block$/', $blockClassName) ? $blockClassName : $blockClassName . 'Block';
83 83
         } catch (\Exception $e) {
84 84
             $moduleBundle = null;
85
-            $blockClassName = '\\' . ucwords($moduleName).'\\'.'Block\\'.ucwords($blockEntity->getBkey());
85
+            $blockClassName = '\\' . ucwords($moduleName) . '\\' . 'Block\\' . ucwords($blockEntity->getBkey());
86 86
             $blockClassName = preg_match('/.*Block$/', $blockClassName) ? $blockClassName : $blockClassName . 'Block';
87 87
             $blockClassNameOld = '\\' . ucwords($moduleName) . '_' . 'Block_' . ucwords($blockEntity->getBkey());
88 88
             $blockClassName = class_exists($blockClassName) ? $blockClassName : $blockClassNameOld;
Please login to merge, or discard this patch.
src/system/BlocksModule/Resources/views/plugins/function.menutree.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -92,21 +92,21 @@  discard block
 block discarded – undo
92 92
 function _htmlList($tree, $treeNodePrefix, $treeClassPrefix, $treeId = '', $treeClass = '', $boostrap = false)
93 93
 {
94 94
     $html = '<ul';
95
-    $html .= !empty($treeId) ? ' id="'.$treeId.'"' : '';
96
-    $html .= !empty($treeClass) ? ' class="'.$treeClass.'"' : '';
95
+    $html .= !empty($treeId) ? ' id="' . $treeId . '"' : '';
96
+    $html .= !empty($treeClass) ? ' class="' . $treeClass . '"' : '';
97 97
     $html .= '>';
98 98
 
99 99
     foreach ($tree as $tab) {
100 100
         $html .= '<li';
101
-        $html .= !empty($treeNodePrefix) ? ' id="'.$treeNodePrefix.$tab['item']['id'].'"' : '';
102
-        $html .= !empty($treeClassPrefix) ? ' class="'.$treeClassPrefix.$tab['item']['id'].'"' : '';
101
+        $html .= !empty($treeNodePrefix) ? ' id="' . $treeNodePrefix . $tab['item']['id'] . '"' : '';
102
+        $html .= !empty($treeClassPrefix) ? ' class="' . $treeClassPrefix . $tab['item']['id'] . '"' : '';
103 103
         $html .= '>';
104
-        $attr  = !empty($tab['item']['title']) ? ' title="'.$tab['item']['title'].'"' : '';
105
-        $attr .= !empty($tab['item']['class']) ? ' class="'.$tab['item']['class'].'"' : '';
104
+        $attr  = !empty($tab['item']['title']) ? ' title="' . $tab['item']['title'] . '"' : '';
105
+        $attr .= !empty($tab['item']['class']) ? ' class="' . $tab['item']['class'] . '"' : '';
106 106
         if (!empty($tab['item']['href'])) {
107
-            $html .= '<a href="'.DataUtil::formatForDisplay($tab['item']['href']).'"'.$attr.'>'.$tab['item']['name'].'</a>';
107
+            $html .= '<a href="' . DataUtil::formatForDisplay($tab['item']['href']) . '"' . $attr . '>' . $tab['item']['name'] . '</a>';
108 108
         } else {
109
-            $html .= '<span'.$attr.'>'.$tab['item']['name'].'</span>';
109
+            $html .= '<span' . $attr . '>' . $tab['item']['name'] . '</span>';
110 110
         }
111 111
         $html .= !empty($tab['nodes']) ? _htmlList($tab['nodes'], $treeNodePrefix, $treeClassPrefix) : '';
112 112
         $html .= '</li>';
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 function _htmlListExt($tree, $treeNodePrefix, $treeClassPrefix, $ext, $depth, $treeId = '', $treeClass = '', $bootstrap = false)
135 135
 {
136 136
     $html = '<ul';
137
-    $html .= !empty($treeId) ? ' id="'.$treeId.'"' : '';
137
+    $html .= !empty($treeId) ? ' id="' . $treeId . '"' : '';
138 138
     if ($bootstrap) {
139 139
         $ulClass = (($depth - 1) > 0) ? "dropdown-menu" : '';
140 140
         if (empty($ulClass)) {
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
         }
143 143
         $html .= !empty($ulClass) ? " class='$ulClass'" : '';
144 144
     } else {
145
-        $html .= !empty($treeClass) ? ' class="'.$treeClass.' '.$ext['level'].$depth.'"' : ' class="'.$ext['level'].$depth.'"';
145
+        $html .= !empty($treeClass) ? ' class="' . $treeClass . ' ' . $ext['level'] . $depth . '"' : ' class="' . $ext['level'] . $depth . '"';
146 146
     }
147 147
     $html .= '>';
148 148
 
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
             $classes[] = $size == 1 ? $ext['single'] : '';
155 155
             $classes[] = ($i == 1 && $size > 1) ? $ext['first'] : '';
156 156
             $classes[] = ($i == $size && $size > 1) ? $ext['last'] : '';
157
-            $classes[] = !empty($treeClassPrefix) ? $treeClassPrefix.$tab['item']['id'] : '';
157
+            $classes[] = !empty($treeClassPrefix) ? $treeClassPrefix . $tab['item']['id'] : '';
158 158
             $classes[] = !empty($tab['nodes']) ? $ext['parent'] : $ext['childless'];
159 159
         } else {
160 160
             $classes[] = !empty($tab['nodes']) ? $ext['parent'] : '';
@@ -163,18 +163,18 @@  discard block
 block discarded – undo
163 163
         $i++;
164 164
 
165 165
         $html .= '<li';
166
-        $html .= !empty($treeNodePrefix) ? ' id="'.$treeNodePrefix.$tab['item']['id'].'"' : '';
167
-        $html .= !empty($classList) ? ' class="'.$classList.'">' : '>';
168
-        $attr  = !empty($tab['item']['title']) ? ' title="'.$tab['item']['title'].'"' : '';
169
-        $attr .= !empty($tab['item']['class']) ? ' class="'.$tab['item']['class'].'"' : '';
166
+        $html .= !empty($treeNodePrefix) ? ' id="' . $treeNodePrefix . $tab['item']['id'] . '"' : '';
167
+        $html .= !empty($classList) ? ' class="' . $classList . '">' : '>';
168
+        $attr  = !empty($tab['item']['title']) ? ' title="' . $tab['item']['title'] . '"' : '';
169
+        $attr .= !empty($tab['item']['class']) ? ' class="' . $tab['item']['class'] . '"' : '';
170 170
         if (!empty($tab['item']['href'])) {
171 171
             if ($bootstrap && in_array('dropdown', $classes)) {
172
-                $html .= '<a href="#" class="dropdown-toggle" data-toggle="dropdown">'.$tab['item']['name'].' <b class="caret"></b></a>';
172
+                $html .= '<a href="#" class="dropdown-toggle" data-toggle="dropdown">' . $tab['item']['name'] . ' <b class="caret"></b></a>';
173 173
             } else {
174
-                $html .= '<a href="'.DataUtil::formatForDisplay($tab['item']['href']).'"'.$attr.'>'.$tab['item']['name'].'</a>';
174
+                $html .= '<a href="' . DataUtil::formatForDisplay($tab['item']['href']) . '"' . $attr . '>' . $tab['item']['name'] . '</a>';
175 175
             }
176 176
         } else {
177
-            $html .= '<span'.$attr.'>'.$tab['item']['name'].'</span>';
177
+            $html .= '<span' . $attr . '>' . $tab['item']['name'] . '</span>';
178 178
         }
179 179
         $html .= !empty($tab['nodes']) ? _htmlListExt($tab['nodes'], $treeNodePrefix, $treeClassPrefix, $ext, $depth + 1, '', '', $bootstrap) : '';
180 180
         $html .= '</li>';
Please login to merge, or discard this patch.
src/system/BlocksModule/Resources/views/plugins/block.menu.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
         $item['content'] = $params['_content'][$i];
133 133
 
134 134
         if (!isset($item['id'])) {
135
-            $item['id'] = 'dummy_'.$i;
135
+            $item['id'] = 'dummy_' . $i;
136 136
         }
137 137
 
138 138
         $_node = [
@@ -175,21 +175,21 @@  discard block
 block discarded – undo
175 175
  */
176 176
 function _smarty_block_menu_parsemenu_html($tree, $listTag, $listClass = null, $listId = null)
177 177
 {
178
-    $html  = '<'.$listTag;
179
-    $html .= !empty($listId) ? ' id="'.$listId.'"' : '';
180
-    $html .= !empty($listClass) ? ' class="'.$listClass.'"' : '';
178
+    $html  = '<' . $listTag;
179
+    $html .= !empty($listId) ? ' id="' . $listId . '"' : '';
180
+    $html .= !empty($listClass) ? ' class="' . $listClass . '"' : '';
181 181
     $html .= '>';
182 182
 
183 183
     foreach ($tree as $tab) {
184 184
         if (!empty($tab['nodes'])) {
185 185
             $subhtml = _smarty_block_menu_parsemenu_html($tab['nodes'], $listTag);
186
-            $html .= preg_replace('/<\/li>\s*$/Di', $subhtml.'</li>', $tab['item']['content'], 1);
186
+            $html .= preg_replace('/<\/li>\s*$/Di', $subhtml . '</li>', $tab['item']['content'], 1);
187 187
         } else {
188 188
             $html .= $tab['item']['content'];
189 189
         }
190 190
     }
191 191
 
192
-    $html .= '</'.$listTag.'>';
192
+    $html .= '</' . $listTag . '>';
193 193
 
194 194
     return $html;
195 195
 }
@@ -205,14 +205,14 @@  discard block
 block discarded – undo
205 205
     $listId    = isset($params['id']) ? $params['id'] : null;
206 206
     $listTag   = isset($params['tag']) ? $params['tag'] : 'ul';
207 207
 
208
-    $html  = '<'.$listTag;
209
-    $html .= !empty($listId) ? ' id="'.$listId.'"' : '';
210
-    $html .= !empty($listClass) ? ' class="'.$listClass.'"' : '';
208
+    $html  = '<' . $listTag;
209
+    $html .= !empty($listId) ? ' id="' . $listId . '"' : '';
210
+    $html .= !empty($listClass) ? ' class="' . $listClass . '"' : '';
211 211
     $html .= '>';
212 212
 
213 213
     $html .= $params['_content'];
214 214
 
215
-    $html .= '</'.$listTag.'>';
215
+    $html .= '</' . $listTag . '>';
216 216
 
217 217
     return $html;
218 218
 }
Please login to merge, or discard this patch.
src/system/RoutesModule/Translation/ZikulaPatternGenerationStrategy.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -104,7 +104,7 @@
 block discarded – undo
104 104
                 || (self::STRATEGY_PREFIX_EXCEPT_DEFAULT === $this->strategy && $this->defaultLocale !== $locale)) {
105 105
                 $i18nPattern = '/' . $locale . $i18nPattern;
106 106
                 if (null !== $route->getOption('i18n_prefix')) {
107
-                    $i18nPattern = $route->getOption('i18n_prefix').$i18nPattern;
107
+                    $i18nPattern = $route->getOption('i18n_prefix') . $i18nPattern;
108 108
                 }
109 109
             }
110 110
 
Please login to merge, or discard this patch.
src/system/MenuModule/Block/Form/Type/MenuType.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,10 +39,10 @@
 block discarded – undo
39 39
         ;
40 40
         $builder->get('options')
41 41
             ->addModelTransformer(new CallbackTransformer(
42
-                function ($text) {
42
+                function($text) {
43 43
                     return $text;
44 44
                 },
45
-                function ($text) {
45
+                function($text) {
46 46
                     if (empty($text)) {
47 47
                         return '{}';
48 48
                     }
Please login to merge, or discard this patch.
src/system/MenuModule/Controller/NodeController.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -122,9 +122,9 @@
 block discarded – undo
122 122
         $entityId = str_replace($this->domTreeNodePrefix, '', $node['id']);
123 123
         $menuItemEntity = $repo->find($entityId);
124 124
         $oldParent = $request->request->get('old_parent');
125
-        $oldPosition = (int) $request->request->get('old_position');
125
+        $oldPosition = (int)$request->request->get('old_position');
126 126
         $parent = $request->request->get('parent');
127
-        $position = (int) $request->request->get('position');
127
+        $position = (int)$request->request->get('position');
128 128
         if ($oldParent == $parent) {
129 129
             $diff = $oldPosition - $position; // if $diff is positive, then node moved up
130 130
             $methodName = $diff > 0 ? 'moveUp' : 'moveDown';
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,8 @@
 block discarded – undo
56 56
                         $parent = $repo->find($request->request->get('parent'));
57 57
                         $menuItemEntity->setParent($parent);
58 58
                         $menuItemEntity->setRoot($parent->getRoot());
59
-                    } elseif (empty($parentId) && $request->request->has('after')) { // sibling of top-level child
59
+                    } elseif (empty($parentId) && $request->request->has('after')) {
60
+// sibling of top-level child
60 61
                         $sibling = $repo->find($request->request->get('after'));
61 62
                         $menuItemEntity->setParent($sibling->getParent());
62 63
                         $menuItemEntity->setRoot($sibling->getRoot());
Please login to merge, or discard this patch.
src/system/CategoriesModule/Entity/Repository/CategoryRepository.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,12 +36,12 @@
 block discarded – undo
36 36
 
37 37
         if ($parentId > 0) {
38 38
             $qb->andWhere('c.parent = :parentid')
39
-               ->setParameter('parentid', $parentId);
39
+                ->setParameter('parentid', $parentId);
40 40
         }
41 41
 
42 42
         if ($excludedId > 0) {
43 43
             $qb->andWhere('c.id != :id')
44
-               ->setParameter('id', $excludedId);
44
+                ->setParameter('id', $excludedId);
45 45
         }
46 46
 
47 47
         $query = $qb->getQuery();
Please login to merge, or discard this patch.
CategoriesModule/Form/DataTransformer/CategoriesCollectionTransformer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
         $class = $this->entityCategoryClass;
36 36
 
37 37
         foreach ($value as $regId => $categories) {
38
-            $regId = (int) substr($regId, strpos($regId, '_') + 1);
38
+            $regId = (int)substr($regId, strpos($regId, '_') + 1);
39 39
             $subCollection = new ArrayCollection();
40 40
             if (!is_array($categories) && $categories instanceof CategoryEntity) {
41 41
                 $categories = [$categories];
Please login to merge, or discard this patch.