Passed
Pull Request — master (#2712)
by Christian
13:50 queued 06:33
created
sites/default/boinc/modules/contrib/features/includes/features.ctools.inc 1 patch
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -110,8 +110,7 @@  discard block
 block discarded – undo
110 110
   if ($schema && $schema['export']['bulk export']) {
111 111
     if (!empty($schema['export']['list callback']) && function_exists($schema['export']['list callback'])) {
112 112
       $options = $schema['export']['list callback']();
113
-    }
114
-    else {
113
+    } else {
115 114
       $options = _ctools_features_export_default_list($component, $schema);
116 115
     }
117 116
   }
@@ -165,8 +164,7 @@  discard block
 block discarded – undo
165 164
     $code = explode('}', implode($code, "{\n"));
166 165
     array_pop($code);
167 166
     $code = implode('}', $code);
168
-  }
169
-  else {
167
+  } else {
170 168
     $code = '  $export = array();'."\n\n";
171 169
     foreach ($data as $object_name) {
172 170
       if ($object = _ctools_features_export_crud_load($component, $object_name)) {
@@ -264,8 +262,7 @@  discard block
 block discarded – undo
264 262
 function _ctools_features_export_crud_load($table, $name) {
265 263
   if (ctools_api_version('1.7')) {
266 264
     return ctools_export_crud_load($table, $name);
267
-  }
268
-  elseif ($objects = ctools_export_load_object($table, 'names', array($name))) {
265
+  } elseif ($objects = ctools_export_load_object($table, 'names', array($name))) {
269 266
     return array_shift($objects);
270 267
   }
271 268
   return FALSE;
@@ -277,8 +274,7 @@  discard block
 block discarded – undo
277 274
 function _ctools_features_export_default_list($table, $schema) {
278 275
   if (ctools_api_version('1.7')) {
279 276
     return ctools_export_default_list($table, $schema);
280
-  }
281
-  elseif ($objects = ctools_export_load_object($table, 'all')) {
277
+  } elseif ($objects = ctools_export_load_object($table, 'all')) {
282 278
     return drupal_map_assoc(array_keys($objects));
283 279
   }
284 280
   return array();
@@ -290,8 +286,7 @@  discard block
 block discarded – undo
290 286
 function _ctools_features_export_crud_delete($table, $object) {
291 287
   if (ctools_api_version('1.7')) {
292 288
     ctools_export_crud_delete($table, $object);
293
-  }
294
-  else {
289
+  } else {
295 290
     $schema = ctools_export_get_schema($table);
296 291
     $export = $schema['export'];
297 292
     db_query("DELETE FROM {{$table}} WHERE {$export['key']} = '%s'", $object->{$export['key']});
Please login to merge, or discard this patch.
sites/default/boinc/modules/contrib/features/includes/features.menu.inc 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -68,8 +68,7 @@  discard block
 block discarded – undo
68 68
     // If this menu is provided by a different module, add it as a dependency.
69 69
     if (isset($map[$menu_name]) && $map[$menu_name] != $module_name) {
70 70
       $export['dependencies'][$map[$menu_name]] = $map[$menu_name];
71
-    }
72
-    else {
71
+    } else {
73 72
       $export['features']['menu_custom'][$menu_name] = $menu_name;
74 73
     }
75 74
   }
@@ -215,8 +214,7 @@  discard block
 block discarded – undo
215 214
       // If this link is provided by a different module, add it as a dependency.
216 215
       if (isset($map[$identifier]) && $map[$identifier] != $module_name) {
217 216
         $export['dependencies'][$map[$identifier]] = $map[$identifier];
218
-      }
219
-      else {
217
+      } else {
220 218
         $export['features']['menu_links'][$identifier] = $identifier;
221 219
       }
222 220
       // For now, exclude a variety of common menus from automatic export.
@@ -300,8 +298,7 @@  discard block
 block discarded – undo
300 298
             $ordered[$identifier] = 0;
301 299
             $all_links[$identifier] = $link;
302 300
             unset($unordered[$key]);
303
-          }
304
-          elseif (isset($ordered[$parent])) {
301
+          } elseif (isset($ordered[$parent])) {
305 302
             $ordered[$identifier] = $ordered[$parent] + 1;
306 303
             $all_links[$identifier] = $link;
307 304
             unset($unordered[$key]);
@@ -324,8 +321,7 @@  discard block
 block discarded – undo
324 321
       // Retrieve the plid for a parent link.
325 322
       if (!empty($link['parent_path']) && $parent = features_menu_link_load("{$link['menu_name']}:{$link['parent_path']}")) {
326 323
         $link['plid'] = $parent['mlid'];
327
-      }
328
-      else {
324
+      } else {
329 325
         $link['plid'] = 0;
330 326
       }
331 327
       menu_link_save($link);
Please login to merge, or discard this patch.
default/boinc/modules/contrib/features/includes/features.imagecache.inc 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -82,8 +82,7 @@
 block discarded – undo
82 82
     foreach ($preset as $k => $v) {
83 83
       if (in_array($k, $omit, TRUE)) {
84 84
         unset($preset[$k]);
85
-      }
86
-      else if (is_array($v)) {
85
+      } else if (is_array($v)) {
87 86
         _imagecache_features_preset_sanitize($preset[$k]);
88 87
       }
89 88
     }
Please login to merge, or discard this patch.
sites/default/boinc/modules/contrib/features/includes/features.views.inc 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -116,8 +116,7 @@  discard block
 block discarded – undo
116 116
         if ($v = views_get_view($view_name)) {
117 117
           if ($v->type === 'Overridden') {
118 118
             $conflicts[$map[$view_name]] = $view_name;
119
-          }
120
-          elseif ($v->type === 'Default') {
119
+          } elseif ($v->type === 'Default') {
121 120
             $export['dependencies'][$map[$view_name]] = $map[$view_name];
122 121
           }
123 122
         }
@@ -213,8 +212,7 @@  discard block
 block discarded – undo
213 212
         foreach ($tables as $table => $info) {
214 213
           if (isset($info['table']) && (!isset($map[$table]) || $info['table']['group'])) {
215 214
             $map[$table] = $module;
216
-          }
217
-          else if (!isset($map[$table])) {
215
+          } else if (!isset($map[$table])) {
218 216
             $map[$table] = $module;
219 217
           }
220 218
         }
Please login to merge, or discard this patch.
sites/default/boinc/modules/contrib/features/includes/features.node.inc 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -98,8 +98,7 @@
 block discarded – undo
98 98
           $text = str_replace("'", "\'", $info->$key);
99 99
           $text = !empty($text) ? "t('{$text}')" : "''";
100 100
           $output[] = "      '{$key}' => {$text},";
101
-        }
102
-        else {
101
+        } else {
103 102
           $output[] = "      '{$key}' => '{$info->$key}',";
104 103
         }
105 104
       }
Please login to merge, or discard this patch.
sites/default/boinc/modules/contrib/features/includes/features.taxonomy.inc 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -40,8 +40,7 @@  discard block
 block discarded – undo
40 40
   foreach ($data as $machine_name) {
41 41
     if (isset($map[$machine_name]) && $map[$machine_name] != $module_name) {
42 42
       $export['dependencies'][$map[$machine_name]] = $map[$machine_name];
43
-    }
44
-    else {
43
+    } else {
45 44
       $export['features']['taxonomy'][$machine_name] = $machine_name;
46 45
     }
47 46
   }
@@ -120,13 +119,11 @@  discard block
 block discarded – undo
120 119
     // This vocabulary is new or wasn't assigned a machine name.
121 120
     $elem['#element_validate'] = array('features_taxonomy_machine_name_validate');
122 121
     unset($form['module']);
123
-  }
124
-  elseif (strpos($form['module']['#value'], 'features_') === 0) {
122
+  } elseif (strpos($form['module']['#value'], 'features_') === 0) {
125 123
     // Simply display the existing machine name if we have one.
126 124
     $elem['#disabled'] = true;
127 125
     $elem['#value'] = substr($form['module']['#value'], 9);
128
-  }
129
-  else {
126
+  } else {
130 127
     // Some other module is responsible here, do nothing.
131 128
     return;
132 129
   }
@@ -156,8 +153,7 @@  discard block
 block discarded – undo
156 153
     $vid = db_result(db_query("SELECT vid FROM {vocabulary} WHERE module = '%s'", $name));
157 154
     if ($vid) {
158 155
       form_error($element, t('This machine name is already taken. Please enter a unique machine name or this taxonomy.'));
159
-    }
160
-    else {
156
+    } else {
161 157
       $form_state['values']['module'] = $name;
162 158
     }
163 159
   }
Please login to merge, or discard this patch.
sites/default/boinc/modules/contrib/features/includes/features.context.inc 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -74,8 +74,7 @@  discard block
 block discarded – undo
74 74
                 $split = explode(':', $item);
75 75
                 $view_name = array_shift($split);
76 76
                 $pipe[$key][$view_name] = $view_name;
77
-              }
78
-              else {
77
+              } else {
79 78
                 $pipe[$key][$item] = $item;
80 79
               }
81 80
             }
@@ -123,8 +122,7 @@  discard block
 block discarded – undo
123 122
             foreach ($context->{$key} as $item) {
124 123
               $pipe[$key][$item] = $item;
125 124
             }
126
-          }
127
-          else {
125
+          } else {
128 126
             $item = $context->{$key};
129 127
             $pipe[$key][$item] = $item;
130 128
           }
Please login to merge, or discard this patch.
drupal/sites/default/boinc/modules/contrib/features/theme/theme.inc 1 patch
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -38,8 +38,7 @@  discard block
 block discarded – undo
38 38
     foreach ($module_conflicts as $conflict) {
39 39
       $conflicts = array_merge_recursive($conflict, $conflicts);
40 40
     }
41
-  }
42
-  else {
41
+  } else {
43 42
     $conflicts = array();
44 43
   }
45 44
   // Display key for conflicting elements.
@@ -162,8 +161,7 @@  discard block
 block discarded – undo
162 161
   if ($path) {
163 162
     $options['attributes']['class'] = $classes[$storage] . ' features-storage';
164 163
     return l($text, $path, $options);
165
-  }
166
-  else {
164
+  } else {
167 165
     return "<span class='{$classes[$storage]} features-storage'>{$text}</span>";
168 166
   }
169 167
 }
@@ -286,8 +284,7 @@  discard block
 block discarded – undo
286 284
     foreach ($export as $component) {
287 285
       if ($component === 'dependencies') {
288 286
         $feature_items = isset($info[$component]) ? $info[$component] : array();
289
-      }
290
-      else {
287
+      } else {
291 288
         $feature_items = isset($info['features'][$component]) ? $info['features'][$component] : array();
292 289
       }
293 290
       $source_items = isset($sources[$component]) ? $sources[$component] : array();
@@ -317,11 +314,9 @@  discard block
 block discarded – undo
317 314
     // If component is not in source list, it was autodetected
318 315
     if (!in_array($component, $source)) {
319 316
       $list[] = "<span class='features-detected'>". check_plain($component) ."</span>";
320
-    }
321
-    elseif (is_array($conflicts) && in_array($component, $conflicts)) {
317
+    } elseif (is_array($conflicts) && in_array($component, $conflicts)) {
322 318
       $list[] = "<span class='features-conflict'>". check_plain($component) ."</span>";
323
-    }
324
-    else {
319
+    } else {
325 320
       $list[] = "<span class='features-source'>". check_plain($component) ."</span>";
326 321
     }
327 322
   }
Please login to merge, or discard this patch.
drupal/sites/default/boinc/modules/contrib/features/features.module 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -569,8 +569,7 @@  discard block
 block discarded – undo
569 569
       foreach ($components as $component => $modules) {
570 570
         if (isset($component_info[$type]['duplicates']) && $component_info[$type]['duplicates'] == FEATURES_DUPLICATES_ALLOWED) {
571 571
           continue;
572
-        }
573
-        else if (count($modules) > 1) {
572
+        } else if (count($modules) > 1) {
574 573
           foreach ($modules as $module) {
575 574
             if (!isset($conflicts[$module])) {
576 575
               $conflicts[$module] = array();
@@ -620,11 +619,9 @@  discard block
 block discarded – undo
620 619
 function features_get_module_status($module) {
621 620
   if (module_exists($module)) {
622 621
     return FEATURES_MODULE_ENABLED;
623
-  }
624
-  else if (features_get_modules($module)) {
622
+  } else if (features_get_modules($module)) {
625 623
     return FEATURES_MODULE_DISABLED;
626
-  }
627
-  else {
624
+  } else {
628 625
     return FEATURES_MODULE_MISSING;
629 626
   }
630 627
 }
@@ -765,8 +762,7 @@  discard block
 block discarded – undo
765 762
     $message = strip_tags($message);
766 763
     if ($severity == 'status') {
767 764
       $severity = 'ok';
768
-    }
769
-    elseif ($severity == 'error') {
765
+    } elseif ($severity == 'error') {
770 766
       drush_set_error($message);
771 767
       return;
772 768
     }
Please login to merge, or discard this patch.