Passed
Branch master (95796a)
by Andreas
38:22
created
src/midcom/datamanager/storage/blobs.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -120,7 +120,7 @@
 block discarded – undo
120 120
 
121 121
         if (!empty($this->config['widget_config']['sortable']))
122 122
         {
123
-            uasort($this->map, function ($a, $b)
123
+            uasort($this->map, function($a, $b)
124 124
             {
125 125
                 if ($a->metadata->score == $b->metadata->score)
126 126
                 {
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -40,8 +40,7 @@  discard block
 block discarded – undo
40 40
             try
41 41
             {
42 42
                 $results[$identifier] = new midcom_db_attachment($guid);
43
-            }
44
-            catch (midcom_error $e)
43
+            } catch (midcom_error $e)
45 44
             {
46 45
                 $e->log();
47 46
             }
@@ -77,8 +76,7 @@  discard block
 block discarded – undo
77 76
                         {
78 77
                             $identifier = md5(time() . $data['file']['name'] . $data['file']['tmp_name']);
79 78
                         }
80
-                    }
81
-                    else
79
+                    } else
82 80
                     {
83 81
                         if ($attachment->name != $filename)
84 82
                         {
@@ -92,8 +90,7 @@  discard block
 block discarded – undo
92 90
                     {
93 91
                         throw new midcom_error('Failed to copy attachment: ' . midcom_connection::get_error_string());
94 92
                     }
95
-                }
96
-                else if ($attachment === null)
93
+                } else if ($attachment === null)
97 94
                 {
98 95
                     continue;
99 96
                 }
Please login to merge, or discard this patch.
src/midcom/datamanager/storage/parameter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
     {
26 26
         //workaround for weird mgd API behavior where setting falsy (i.e. deleting) a nonexistent parameter
27 27
         //returns an error
28
-        if (   !$this->value
28
+        if (!$this->value
29 29
             && $this->load() === null)
30 30
         {
31 31
             return true;
Please login to merge, or discard this patch.
src/midcom/datamanager/storage/photo.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -54,8 +54,7 @@
 block discarded – undo
54 54
             }
55 55
 
56 56
             return $this->save_attachment_list();
57
-        }
58
-        elseif (!empty($this->value['delete']))
57
+        } elseif (!empty($this->value['delete']))
59 58
         {
60 59
             $this->map = array();
61 60
             return $this->save_attachment_list();
Please login to merge, or discard this patch.
src/midcom/workflow/viewer.php 1 patch
Spacing   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -19,11 +19,9 @@
 block discarded – undo
19 19
 {
20 20
     public function get_button_config()
21 21
     {
22
-        return array
23
-        (
22
+        return array(
24 23
             MIDCOM_TOOLBAR_LABEL => midcom::get()->i18n->get_string('view', 'midcom'),
25
-            MIDCOM_TOOLBAR_OPTIONS => array
26
-            (
24
+            MIDCOM_TOOLBAR_OPTIONS => array(
27 25
                 'data-dialog' => 'dialog',
28 26
             )
29 27
         );
Please login to merge, or discard this patch.
src/midcom/workflow/delete.php 2 patches
Spacing   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -80,8 +80,7 @@  discard block
 block discarded – undo
80 80
         }
81 81
 
82 82
         $resolver
83
-            ->setDefaults(array
84
-            (
83
+            ->setDefaults(array(
85 84
                 'recursive' => false,
86 85
                 'success_url' => '',
87 86
                 'label' => null,
@@ -113,13 +112,11 @@  discard block
 block discarded – undo
113 112
             $dialog_text .= '<div id="delete-child-list"></div>';
114 113
         }
115 114
 
116
-        return array
117
-        (
115
+        return array(
118 116
             MIDCOM_TOOLBAR_LABEL => $this->l10n_midcom->get('delete'),
119 117
             MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/trash.png',
120 118
             MIDCOM_TOOLBAR_ACCESSKEY => 'd',
121
-            MIDCOM_TOOLBAR_OPTIONS => array
122
-            (
119
+            MIDCOM_TOOLBAR_OPTIONS => array(
123 120
                 'data-dialog' => 'delete',
124 121
                 'data-form-id' => $this->form_identifier,
125 122
                 'data-dialog-heading' => $this->l10n_midcom->get('confirm delete'),
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -246,8 +246,7 @@
 block discarded – undo
246 246
             {
247 247
                 $result = array();
248 248
                 $size = 0;
249
-            }
250
-            else
249
+            } else
251 250
             {
252 251
                 $result = array_slice($result, $this->_offset);
253 252
                 $size = $size - $this->_offset;
Please login to merge, or discard this patch.
src/midcom/workflow/dialog.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@
 block discarded – undo
75 75
         //The constants are numeric, so array_merge won't work...
76 76
         foreach ($options as $key => $value)
77 77
         {
78
-            if (   is_array($value)
78
+            if (is_array($value)
79 79
                 && !empty($button_config[$key]))
80 80
             {
81 81
                 $value = array_merge($button_config[$key], $value);
Please login to merge, or discard this patch.
src/midcom/workflow/datamanager2.php 2 patches
Spacing   +5 added lines, -8 removed lines patch added patch discarded remove patch
@@ -36,8 +36,7 @@  discard block
 block discarded – undo
36 36
     public function configure(OptionsResolver $resolver)
37 37
     {
38 38
         $resolver
39
-            ->setDefaults(array
40
-            (
39
+            ->setDefaults(array(
41 40
                 'controller' => null,
42 41
                 'save_callback' => null
43 42
             ))
@@ -46,12 +45,10 @@  discard block
 block discarded – undo
46 45
 
47 46
     public function get_button_config()
48 47
     {
49
-        return array
50
-        (
48
+        return array(
51 49
             MIDCOM_TOOLBAR_LABEL => midcom::get()->i18n->get_l10n('midcom')->get('edit'),
52 50
             MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/edit.png',
53
-            MIDCOM_TOOLBAR_OPTIONS => array
54
-            (
51
+            MIDCOM_TOOLBAR_OPTIONS => array(
55 52
                 'data-dialog' => 'dialog',
56 53
                 'data-dialog-cancel-label' => midcom::get()->i18n->get_l10n('midcom')->get('cancel')
57 54
             )
@@ -101,8 +98,8 @@  discard block
 block discarded – undo
101 98
 
102 99
     private function prepare_url($url)
103 100
     {
104
-        if (   substr($url, 0, 1) != '/'
105
-            && ! preg_match('|^https?://|', $url))
101
+        if (substr($url, 0, 1) != '/'
102
+            && !preg_match('|^https?://|', $url))
106 103
         {
107 104
             $url = midcom_core_context::get()->get_key(MIDCOM_CONTEXT_ANCHORPREFIX) . $url;
108 105
         }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -81,8 +81,7 @@
 block discarded – undo
81 81
             {
82 82
                 throw new midcom_error(midcom_connection::get_error_string());
83 83
             }
84
-        }
85
-        else
84
+        } else
86 85
         {
87 86
             $nodes = $object_qb->execute();
88 87
             $node = $nodes[0];
Please login to merge, or discard this patch.
lib/midcom.php 1 patch
Spacing   +5 added lines, -6 removed lines patch added patch discarded remove patch
@@ -38,8 +38,7 @@  discard block
 block discarded – undo
38 38
     /**
39 39
      * Mapping of service names to classes implementing the service
40 40
      */
41
-    private static $_service_classes = array
42
-    (
41
+    private static $_service_classes = array(
43 42
         'auth' => 'midcom_services_auth',
44 43
         'componentloader' => 'midcom_helper__componentloader',
45 44
         'cache' => 'midcom_services_cache',
@@ -67,12 +66,12 @@  discard block
 block discarded – undo
67 66
         ///////////////////////////////////
68 67
         // Try to be smart about the paths:
69 68
         // Define default constants
70
-        if (! defined('MIDCOM_ROOT'))
69
+        if (!defined('MIDCOM_ROOT'))
71 70
         {
72 71
             define('MIDCOM_ROOT', __DIR__);
73 72
         }
74 73
 
75
-        if (! defined('MIDCOM_STATIC_ROOT'))
74
+        if (!defined('MIDCOM_STATIC_ROOT'))
76 75
         {
77 76
             $pos = strrpos(MIDCOM_ROOT, '/');
78 77
             if ($pos === false)
@@ -82,14 +81,14 @@  discard block
 block discarded – undo
82 81
             }
83 82
             define('MIDCOM_STATIC_ROOT', substr(MIDCOM_ROOT, 0, $pos) . '/static');
84 83
         }
85
-        if (! defined('MIDCOM_STATIC_URL'))
84
+        if (!defined('MIDCOM_STATIC_URL'))
86 85
         {
87 86
             define('MIDCOM_STATIC_URL', '/midcom-static');
88 87
         }
89 88
 
90 89
         if (!defined('OPENPSA2_THEME_ROOT'))
91 90
         {
92
-            define ('OPENPSA2_THEME_ROOT', MIDCOM_ROOT . '/../var/themes/');
91
+            define('OPENPSA2_THEME_ROOT', MIDCOM_ROOT . '/../var/themes/');
93 92
         }
94 93
 
95 94
         // Instantiate the MidCOM main class
Please login to merge, or discard this patch.
lib/no/bergfald/rcs/handler.php 2 patches
Spacing   +13 added lines, -21 removed lines patch added patch discarded remove patch
@@ -96,8 +96,7 @@  discard block
 block discarded – undo
96 96
     private function _prepare_toolbars($revision = '', $diff_view = false)
97 97
     {
98 98
         $this->_view_toolbar->add_item(
99
-            array
100
-            (
99
+            array(
101 100
                 MIDCOM_TOOLBAR_URL => midcom::get()->permalinks->create_permalink($this->_guid),
102 101
                 MIDCOM_TOOLBAR_LABEL => sprintf($this->_l10n->get('back to %s'), $this->_resolve_object_title()),
103 102
                 MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/stock_up.png',
@@ -116,7 +115,7 @@  discard block
 block discarded – undo
116 115
         $show_previous = false;
117 116
         if ($diff_view)
118 117
         {
119
-            if (   $before != ''
118
+            if ($before != ''
120 119
                 && $before2 != '')
121 120
             {
122 121
                 // When browsing diffs we want to display buttons to previous instead of current
@@ -137,16 +136,14 @@  discard block
 block discarded – undo
137 136
         $buttons = array();
138 137
         if ($show_previous)
139 138
         {
140
-            $buttons[] = array
141
-            (
139
+            $buttons[] = array(
142 140
                 MIDCOM_TOOLBAR_URL => "__ais/rcs/diff/{$this->_guid}/{$first}/{$second}/",
143 141
                 MIDCOM_TOOLBAR_LABEL => sprintf($this->_l10n->get('view %s differences with previous (%s)'), $second, $first),
144 142
                 MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/stock_left.png',
145 143
             );
146 144
         }
147 145
 
148
-        $buttons[] = array
149
-        (
146
+        $buttons[] = array(
150 147
             MIDCOM_TOOLBAR_URL => "__ais/rcs/preview/{$this->_guid}/{$revision}/",
151 148
             MIDCOM_TOOLBAR_LABEL => sprintf($this->_l10n->get('view this revision (%s)'), $revision),
152 149
             MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/search.png',
@@ -155,16 +152,14 @@  discard block
 block discarded – undo
155 152
         // Display restore and next buttons only if we're not in latest revision
156 153
         if ($after != '')
157 154
         {
158
-            $buttons[] = array
159
-            (
155
+            $buttons[] = array(
160 156
                 MIDCOM_TOOLBAR_URL => "__ais/rcs/restore/{$this->_guid}/{$revision}/",
161 157
                 MIDCOM_TOOLBAR_LABEL => sprintf($this->_l10n->get('restore this revision (%s)'), $revision),
162 158
                 MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/editpaste.png',
163 159
                 MIDCOM_TOOLBAR_ENABLED => $this->_object->can_do('midgard:update'),
164 160
             );
165 161
 
166
-            $buttons[] = array
167
-            (
162
+            $buttons[] = array(
168 163
                 MIDCOM_TOOLBAR_URL => "__ais/rcs/diff/{$this->_guid}/{$revision}/{$after}/",
169 164
                 MIDCOM_TOOLBAR_LABEL => sprintf($this->_l10n->get('view %s differences with next (%s)'), $revision, $after),
170 165
                 MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/stock_right.png',
@@ -222,7 +217,7 @@  discard block
 block discarded – undo
222 217
         $this->_guid = $args[0];
223 218
         $this->_load_object();
224 219
 
225
-        if (   !$this->_backend->version_exists($args[1])
220
+        if (!$this->_backend->version_exists($args[1])
226 221
             || !$this->_backend->version_exists($args[2]))
227 222
         {
228 223
             throw new midcom_error_notfound("One of the revisions {$args[1]} or {$args[2]} does not exist.");
@@ -238,7 +233,7 @@  discard block
 block discarded – undo
238 233
         $this->_request_data['earlier_revision'] = $this->_backend->get_prev_version($args[1]);
239 234
         $this->_request_data['previous_revision'] = $args[1];
240 235
         $this->_request_data['latest_revision'] = $args[2];
241
-        $this->_request_data['next_revision']  = $this->_backend->get_next_version($args[2]);
236
+        $this->_request_data['next_revision'] = $this->_backend->get_next_version($args[2]);
242 237
 
243 238
         $this->_request_data['guid'] = $args[0];
244 239
 
@@ -246,13 +241,11 @@  discard block
 block discarded – undo
246 241
         midcom::get()->head->set_pagetitle($this->_request_data['view_title']);
247 242
 
248 243
         $this->_prepare_breadcrumb();
249
-        $this->add_breadcrumb
250
-        (
244
+        $this->add_breadcrumb(
251 245
             "__ais/rcs/preview/{$this->_guid}/{$data['latest_revision']}/",
252 246
             sprintf($this->_l10n->get('version %s'), $data['latest_revision'])
253 247
         );
254
-        $this->add_breadcrumb
255
-        (
248
+        $this->add_breadcrumb(
256 249
             "__ais/rcs/diff/{$this->_guid}/{$data['previous_revision']}/{$data['latest_revision']}/",
257 250
             sprintf($this->_l10n->get('changes from version %s'), $data['previous_revision'])
258 251
         );
@@ -309,8 +302,7 @@  discard block
 block discarded – undo
309 302
         midcom::get()->head->set_pagetitle($this->_request_data['view_title']);
310 303
 
311 304
         $this->_prepare_breadcrumb();
312
-        $this->add_breadcrumb
313
-        (
305
+        $this->add_breadcrumb(
314 306
             "__ais/rcs/preview/{$this->_guid}/{$revision}/",
315 307
             sprintf($this->_l10n->get('version %s'), $revision)
316 308
         );
@@ -318,7 +310,7 @@  discard block
 block discarded – undo
318 310
         // Set the version numbers
319 311
         $data['previous_revision'] = $this->_backend->get_prev_version($args[1]);
320 312
         $data['latest_revision'] = $args[1];
321
-        $data['next_revision']  = $this->_backend->get_next_version($args[1]);
313
+        $data['next_revision'] = $this->_backend->get_next_version($args[1]);
322 314
         $data['guid'] = $args[0];
323 315
     }
324 316
 
@@ -347,7 +339,7 @@  discard block
 block discarded – undo
347 339
 
348 340
         $this->_prepare_toolbars($args[1]);
349 341
 
350
-        if (   $this->_backend->version_exists($args[1])
342
+        if ($this->_backend->version_exists($args[1])
351 343
             && $this->_backend->restore_to_revision($args[1]))
352 344
         {
353 345
             midcom::get()->uimessages->add($this->_l10n->get($this->_component), sprintf($this->_l10n->get('restore to version %s successful'), $args[1]));
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -81,8 +81,7 @@
 block discarded – undo
81 81
             {
82 82
                 throw new midcom_error(midcom_connection::get_error_string());
83 83
             }
84
-        }
85
-        else
84
+        } else
86 85
         {
87 86
             $nodes = $object_qb->execute();
88 87
             $node = $nodes[0];
Please login to merge, or discard this patch.