Passed
Pull Request — master (#193)
by
unknown
20:53
created
lib/net/nemein/rss/fetch.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
             $etag = trim($parser->data['headers']['etag']);
102 102
 
103 103
             $feed_etag = $this->_feed->get_parameter('net.nemein.rss', 'etag');
104
-            if (   !empty($feed_etag)
104
+            if (!empty($feed_etag)
105 105
                 && $feed_etag == $etag) {
106 106
                 // Feed hasn't changed, skip updating
107 107
                 debug_add("Feed {$this->_feed->url} has not changed since " . date('c', $this->_feed->latestfetch), MIDCOM_LOG_WARN);
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
         $guid = $item->get_id();
188 188
         $title = $item->get_title();
189 189
 
190
-        if (   (   empty($title)
190
+        if ((empty($title)
191 191
                 || trim($title) == '...')
192 192
             && empty($guid)) {
193 193
             // Something wrong with this entry, skip it
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
                 $meta_values['published'] = $article_date;
256 256
             }
257 257
 
258
-            if (   $this->apply_values($article, $values, $meta_values)
258
+            if ($this->apply_values($article, $values, $meta_values)
259 259
                 && !$article->update()) {
260 260
                 return false;
261 261
             }
@@ -284,14 +284,14 @@  discard block
 block discarded – undo
284 284
     private function find_author(net_nemein_rss_parser_item $item)
285 285
     {
286 286
         // Try to figure out item author
287
-        if (   $this->_feed->forceauthor
287
+        if ($this->_feed->forceauthor
288 288
             && $this->_feed->defaultauthor) {
289 289
             // Feed has a "default author" set, use it
290 290
             return new midcom_db_person($this->_feed->defaultauthor);
291 291
         }
292 292
         $author = $this->match_item_author($item);
293 293
         $fallback_person_id = 1;
294
-        if (   !$author
294
+        if (!$author
295 295
             || $author->id == $fallback_person_id) {
296 296
             if ($this->_feed->defaultauthor) {
297 297
                 // Feed has a "default author" set, use it
@@ -477,7 +477,7 @@  discard block
 block discarded – undo
477 477
             }
478 478
         }
479 479
 
480
-        if (   !empty($author_info['username'])
480
+        if (!empty($author_info['username'])
481 481
             && $person = midcom::get()->auth->get_user_by_name($author_info['username'])) {
482 482
             return $person->get_storage();
483 483
         }
Please login to merge, or discard this patch.
lib/net/nehmer/static/navigation.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
         $qb->add_constraint('name', '<>', '');
47 47
 
48 48
         // Unless in Auto-Index mode or the index article is hidden, we skip the index article.
49
-        if (   !$this->_config->get('autoindex')
49
+        if (!$this->_config->get('autoindex')
50 50
             && !$this->_config->get('indexinnav')) {
51 51
             $qb->add_constraint('name', '<>', 'index');
52 52
         }
Please login to merge, or discard this patch.
lib/midgard/admin/asgard/handler/type.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -109,8 +109,8 @@
 block discarded – undo
109 109
         }
110 110
 
111 111
         $help = new midcom_admin_help_help();
112
-        $this->_request_data['help'] =  $help->get_help_contents('asgard_'.$this->type, $help_component);
113
-        $this->_request_data['component'] =  $component;
112
+        $this->_request_data['help'] = $help->get_help_contents('asgard_' . $this->type, $help_component);
113
+        $this->_request_data['component'] = $component;
114 114
     }
115 115
 
116 116
     /**
Please login to merge, or discard this patch.
lib/midgard/admin/asgard/handler/undelete.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@
 block discarded – undo
96 96
         $data['reflector'] = midcom_helper_reflector::get($data['type']);
97 97
         $data['label_property'] = $data['reflector']->get_label_property();
98 98
 
99
-        if (   isset($_POST['undelete'])
99
+        if (isset($_POST['undelete'])
100 100
             && is_array($_POST['undelete'])) {
101 101
             if (isset($_POST['purge'])) {
102 102
                 $this->_purge();
Please login to merge, or discard this patch.
lib/midgard/admin/asgard/handler/welcome.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 
21 21
         // List installed MgdSchema types and convert to DBA classes
22 22
         foreach ($this->_request_data['schema_types'] as $schema_type) {
23
-            if (   !is_null($type)
23
+            if (!is_null($type)
24 24
                 && $schema_type != $type) {
25 25
                 // Skip
26 26
                 continue;
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
                 $qb->add_constraint('metadata.revised', '>=', $since);
50 50
             }
51 51
 
52
-            if (   $only_mine
52
+            if ($only_mine
53 53
                 && midcom::get()->auth->user) {
54 54
                 $qb->add_constraint('metadata.authors', 'LIKE', '|' . midcom::get()->auth->user->guid . '|');
55 55
             }
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 
94 94
         $data['view_title'] = $this->_l10n->get('asgard');
95 95
 
96
-        if (    isset($_POST['execute_mass_action'])
96
+        if (isset($_POST['execute_mass_action'])
97 97
              && !empty($_POST['selections'])
98 98
              && isset($_POST['mass_action'])) {
99 99
             $method_name = "_mass_{$_POST['mass_action']}";
@@ -108,14 +108,14 @@  discard block
 block discarded – undo
108 108
             }
109 109
 
110 110
             $data['review_by'] = null;
111
-            if (   $this->_config->get('enable_review_dates')
111
+            if ($this->_config->get('enable_review_dates')
112 112
                 && isset($_REQUEST['review_by'])
113 113
                 && $_REQUEST['review_by'] != 'any') {
114 114
                 $data['review_by'] = (int) $_REQUEST['review_by'];
115 115
             }
116 116
 
117 117
             $data['type_filter'] = null;
118
-            if (   isset($_REQUEST['type_filter'])
118
+            if (isset($_REQUEST['type_filter'])
119 119
                 && $_REQUEST['type_filter'] != 'any') {
120 120
                 $data['type_filter'] = $_REQUEST['type_filter'];
121 121
             }
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
                 continue;
275 275
             }
276 276
 
277
-            if (   $object->can_do('midgard:update')
277
+            if ($object->can_do('midgard:update')
278 278
                 && $object->can_do('midcom:approve')) {
279 279
                 $object->metadata->approve();
280 280
                 midcom::get()->uimessages->add($this->_l10n->get('midgard.admin.asgard'), sprintf($this->_l10n->get('object %s approved'), $object->guid));
Please login to merge, or discard this patch.
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -147,7 +147,8 @@  discard block
 block discarded – undo
147 147
         foreach ($activities as $activity) {
148 148
             try {
149 149
                 $object = midcom::get()->dbfactory->get_object_by_guid($activity->target);
150
-            } catch (midcom_error $e) {
150
+            }
151
+            catch (midcom_error $e) {
151 152
                 if (midcom_connection::get_error() == MGD_ERR_OBJECT_DELETED) {
152 153
                     // TODO: Visualize deleted objects somehow
153 154
                 }
@@ -155,7 +156,8 @@  discard block
 block discarded – undo
155 156
             }
156 157
             try {
157 158
                 $actor = midcom_db_person::get_cached($activity->actor);
158
-            } catch (midcom_error $e) {
159
+            }
160
+            catch (midcom_error $e) {
159 161
                 $actor = null;
160 162
             }
161 163
 
@@ -253,7 +255,8 @@  discard block
 block discarded – undo
253 255
         foreach ($guids as $guid) {
254 256
             try {
255 257
                 $object = midcom::get()->dbfactory->get_object_by_guid($guid);
256
-            } catch (midcom_error $e) {
258
+            }
259
+            catch (midcom_error $e) {
257 260
                 continue;
258 261
             }
259 262
 
@@ -270,7 +273,8 @@  discard block
 block discarded – undo
270 273
         foreach ($guids as $guid) {
271 274
             try {
272 275
                 $object = midcom::get()->dbfactory->get_object_by_guid($guid);
273
-            } catch (midcom_error $e) {
276
+            }
277
+            catch (midcom_error $e) {
274 278
                 continue;
275 279
             }
276 280
 
Please login to merge, or discard this patch.
src/midcom/datamanager/storage/blobs.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@
 block discarded – undo
100 100
         }
101 101
 
102 102
         if (!empty($this->config['widget_config']['sortable'])) {
103
-            uasort($this->map, function ($a, $b) {
103
+            uasort($this->map, function($a, $b) {
104 104
                 if ($a->metadata->score == $b->metadata->score) {
105 105
                     return strnatcasecmp($a->name, $b->name);
106 106
                 }
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,8 @@
 block discarded – undo
37 37
         foreach ($items as $identifier => $guid) {
38 38
             try {
39 39
                 $results[$identifier] = new midcom_db_attachment($guid);
40
-            } catch (midcom_error $e) {
40
+            }
41
+            catch (midcom_error $e) {
41 42
                 $e->log();
42 43
             }
43 44
         }
Please login to merge, or discard this patch.
src/midcom/datamanager/storage/mnrelation.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@
 block discarded – undo
99 99
         $qb = midcom::get()->dbfactory->new_query_builder($this->config['type_config']['mapping_class_name']);
100 100
         $qb->add_constraint($this->config['type_config']['master_fieldname'], '=', $this->get_master_foreign_key());
101 101
 
102
-        if (   $this->config['type_config']['sortable']
102
+        if ($this->config['type_config']['sortable']
103 103
             && preg_match('/^(ASC|DESC)/i', $this->config['type_config']['sortable_sort_order'], $regs)) {
104 104
             $order = strtoupper($regs[1]);
105 105
             $qb->add_order('metadata.score', $order);
Please login to merge, or discard this patch.
src/midcom/datamanager/indexer/document.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
             $this->content .= "{$this->abstract}\n";
138 138
         }
139 139
 
140
-        if (! $this->title) {
140
+        if (!$this->title) {
141 141
             $this->title = $this->document_url;
142 142
         }
143 143
     }
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
                     if (!empty($field->vars['value'])) {
179 179
                         //only index the first attachment for now
180 180
                         $attachment = array_shift($field->vars['value']);
181
-                        if (   !$attachment instanceof \midcom_db_attachment
181
+                        if (!$attachment instanceof \midcom_db_attachment
182 182
                             && !empty($attachment['object'])) {
183 183
                             //This is the form edit case
184 184
                             //@todo: In create case, nothing is found currently
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
      */
263 263
     private function resolve_auto_method($name)
264 264
     {
265
-        if (   $name == 'abstract'
265
+        if ($name == 'abstract'
266 266
             || $name == 'title'
267 267
             || $name == 'author') {
268 268
             return $name;
Please login to merge, or discard this patch.
lib/org/openpsa/directmarketing/handler/logger.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
         $qb = org_openpsa_directmarketing_campaign_messagereceipt_dba::new_query_builder();
86 86
         $qb->add_constraint('token', '=', $token);
87 87
         $qb->add_constraint('orgOpenpsaObtype', '=', $type);
88
-        $ret =  $qb->execute();
88
+        $ret = $qb->execute();
89 89
         debug_print_r("_qb_token_receipts({$token}) returned", $ret);
90 90
         if (empty($ret)) {
91 91
             midcom::get()->auth->drop_sudo();
Please login to merge, or discard this patch.