Passed
Push — master ( 5e492c...d46fa5 )
by Andreas
11:53 queued 02:12
created
lib/midgard/admin/asgard/navigation.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
         $this->_component = 'midgard.admin.asgard';
35 35
 
36 36
         $this->_object = $object;
37
-        $this->_request_data =& $request_data;
37
+        $this->_request_data = & $request_data;
38 38
 
39 39
         $root_types = midgard_admin_asgard_plugin::get_root_classes();
40 40
 
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
             // we go through the path bottom up and show the first root type we find
51 51
             foreach (array_reverse($this->_object_path) as $node) {
52 52
                 foreach (array_keys($root_types) as $root_type) {
53
-                    if (   $node instanceof $root_type
53
+                    if ($node instanceof $root_type
54 54
                         || midcom_helper_reflector::is_same_class($root_type, $node->__midcom_class_name__)) {
55 55
                         $this->expanded_root_types[] = $root_type;
56 56
                         break;
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 
63 63
     protected function _is_collapsed(string $type, int $total) : bool
64 64
     {
65
-        return (   $total > $this->_config->get('max_navigation_entries')
65
+        return ($total > $this->_config->get('max_navigation_entries')
66 66
                 && empty($_GET['show_all_' . $type]));
67 67
     }
68 68
 
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
         foreach ($ref->get_child_classes() as $class) {
79 79
             $qb = $ref->_child_objects_type_qb($class, $object, false);
80 80
 
81
-            if (   !$qb
81
+            if (!$qb
82 82
                 || !($count = $qb->count_unchecked())) {
83 83
                 continue;
84 84
             }
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
     {
125 125
         $qb = $ref->_root_objects_qb();
126 126
 
127
-        if (   !$qb
127
+        if (!$qb
128 128
             || !($total = $qb->count_unchecked())) {
129 129
             return;
130 130
         }
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
         }
203 203
 
204 204
         echo "<a href=\"" . midcom_connection::get_url('self') . "__mfa/asgard/object/{$mode}/{$object->guid}/\" title=\"GUID: {$object->guid}, ID: {$object->id}\">{$icon}{$label}</a>\n";
205
-        if (   $selected
205
+        if ($selected
206 206
             || $autoexpand) {
207 207
             $this->_list_child_elements($object, $level + 1);
208 208
         }
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
                 continue;
223 223
             }
224 224
 
225
-            if (   method_exists($class, 'navigation')
225
+            if (method_exists($class, 'navigation')
226 226
                 && ($this->_request_data['plugin_name'] == "asgard_{$component}")) {
227 227
                 $this->_request_data['expanded'] = true;
228 228
                 midcom_show_style('midgard_admin_asgard_navigation_section_header');
@@ -256,13 +256,13 @@  discard block
 block discarded – undo
256 256
         if ($this->_is_selected($object)) {
257 257
             $css_class .= ' selected';
258 258
         }
259
-        if (   is_object($this->_object)
260
-            && (   $object->guid == $this->_object->guid
261
-                || (   $this->_object instanceof midcom_db_parameter
259
+        if (is_object($this->_object)
260
+            && ($object->guid == $this->_object->guid
261
+                || ($this->_object instanceof midcom_db_parameter
262 262
                     && $object->guid == $this->_object->parentguid))) {
263 263
             $css_class .= ' current';
264 264
         }
265
-        if ( !$object->can_do('midgard:update')) {
265
+        if (!$object->can_do('midgard:update')) {
266 266
             $css_class .= ' readonly';
267 267
         }
268 268
         return $css_class;
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
         // Get the types that might have special display conditions
284 284
         // @TODO: Should this just include to the configuration selection, although it would break the consistency
285 285
         // of other similar preference sets, which simply override the global settings?
286
-        if (   ($selected = midgard_admin_asgard_plugin::get_preference('midgard_types'))
286
+        if (($selected = midgard_admin_asgard_plugin::get_preference('midgard_types'))
287 287
             && preg_match_all('/\|([a-z0-9\.\-_]+)/', $selected, $regs)) {
288 288
             $types = array_flip($regs[1]);
289 289
             if ($exclude) {
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
             }
302 302
 
303 303
             // If the regular expression has been set, check which types should be shown
304
-            $label_mapping = array_filter($label_mapping, function ($root_type) use ($regexp, $exclude) {
304
+            $label_mapping = array_filter($label_mapping, function($root_type) use ($regexp, $exclude) {
305 305
                 return preg_match($regexp, $root_type) == $exclude;
306 306
             }, ARRAY_FILTER_USE_KEY);
307 307
         }
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
          * click if nothing is expanded
332 332
          */
333 333
         $types_shown = false;
334
-        if (    !empty($expanded_types)
334
+        if (!empty($expanded_types)
335 335
              && midgard_admin_asgard_plugin::get_preference('navigation_type') === 'dropdown') {
336 336
             $this->_draw_select_navigation();
337 337
             $types_shown = true;
Please login to merge, or discard this patch.