Passed
Push — master ( 805652...eccbd5 )
by Andreas
26:13
created
lib/midgard/admin/asgard/stylehelper.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@
 block discarded – undo
94 94
                 'midcom' => [
95 95
                     'style-init' => '',
96 96
                     'style-finish' => '',
97
-                 ]
97
+                    ]
98 98
             ],
99 99
             'nodes' => [],
100 100
         ];
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 
23 23
     public function __construct(array &$data)
24 24
     {
25
-        $this->_data =& $data;
25
+        $this->_data = & $data;
26 26
         midcom::get()->head->enable_jquery_ui(['accordion']);
27 27
     }
28 28
 
@@ -33,11 +33,11 @@  discard block
 block discarded – undo
33 33
             return;
34 34
         }
35 35
 
36
-        if (   midcom::get()->dbfactory->is_a($this->_data['object'], 'midgard_style')
37
-            && (   $this->_data['handler_id'] !== 'object_create'
36
+        if (midcom::get()->dbfactory->is_a($this->_data['object'], 'midgard_style')
37
+            && ($this->_data['handler_id'] !== 'object_create'
38 38
                 || $this->_data['current_type'] == 'midgard_element')) {
39 39
             $help_element = $this->_get_help_style_elementnames($this->_data['object']);
40
-        } elseif (   midcom::get()->dbfactory->is_a($this->_data['object'], 'midgard_element')
40
+        } elseif (midcom::get()->dbfactory->is_a($this->_data['object'], 'midgard_element')
41 41
                   && $this->_data['handler_id'] !== 'object_create') {
42 42
             $help_element = $this->_get_help_element();
43 43
         }
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 
50 50
     private function _get_help_element()
51 51
     {
52
-        if (   empty($this->_data['object']->name)
52
+        if (empty($this->_data['object']->name)
53 53
             || empty($this->_data['object']->style)) {
54 54
             // We cannot help with empty elements
55 55
             return;
Please login to merge, or discard this patch.
lib/midcom/helper/reflector/tree.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -553,7 +553,8 @@
 block discarded – undo
553 553
         $tree = [];
554 554
         try {
555 555
             $children = self::get_child_objects($parent);
556
-        } catch (midcom_error $e) {
556
+        }
557
+        catch (midcom_error $e) {
557 558
             return $tree;
558 559
         }
559 560
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
     private static function _check_permissions(bool $deleted) : bool
93 93
     {
94 94
         // PONDER: Check for some generic user privilege instead  ??
95
-        if (   $deleted
95
+        if ($deleted
96 96
             && !midcom_connection::is_admin()
97 97
             && !midcom::get()->auth->is_component_sudo()) {
98 98
             debug_add('Non-admins are not allowed to list deleted objects', MIDCOM_LOG_ERROR);
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
             $field_type = $field_data['type'];
222 222
             $field = $field_data['name'];
223 223
 
224
-            if (   !$field_target
224
+            if (!$field_target
225 225
                 || !isset($for_object->$field_target)) {
226 226
                 // Why return false ???
227 227
                 return false;
Please login to merge, or discard this patch.
lib/midcom/helper/toolbar/view.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
             ]);
55 55
         }
56 56
 
57
-        if (   midcom::get()->config->get('midcom_services_rcs_enable')
57
+        if (midcom::get()->config->get('midcom_services_rcs_enable')
58 58
             && $object->can_do('midgard:update')
59 59
             && $object->_use_rcs) {
60 60
             $buttons[] = [
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
             }
85 85
 
86 86
             $icon = 'stock-icons/16x16/page-' . $icontype . '.png';
87
-            if (   !midcom::get()->config->get('show_hidden_objects')
87
+            if (!midcom::get()->config->get('show_hidden_objects')
88 88
                 && !$object->metadata->is_visible()) {
89 89
                 // Take scheduling into account
90 90
                 $icon = 'stock-icons/16x16/page-' . $icontype . '-notpublished.png';
Please login to merge, or discard this patch.
lib/org/openpsa/slideshow/image.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -150,7 +150,7 @@
 block discarded – undo
150 150
         $rows = $mc->get_rows(['id', 'name', 'guid'], 'id');
151 151
 
152 152
         foreach ($images as $image) {
153
-            if (   !isset($rows[$image->attachment])
153
+            if (!isset($rows[$image->attachment])
154 154
                 || !isset($rows[$image->image])
155 155
                 || !isset($rows[$image->thumbnail])) {
156 156
                 continue;
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -48,7 +48,8 @@  discard block
 block discarded – undo
48 48
 
49 49
         try {
50 50
             $folder = midcom_db_topic::get_cached($this->topic);
51
-        } catch (midcom_error $e) {
51
+        }
52
+        catch (midcom_error $e) {
52 53
             $e->log();
53 54
         }
54 55
         $folder->delete_attachment(self::FOLDER_THUMBNAIL);
@@ -58,7 +59,8 @@  discard block
 block discarded – undo
58 59
     {
59 60
         try {
60 61
             return new midcom_db_attachment($this->$type);
61
-        } catch (midcom_error $e) {
62
+        }
63
+        catch (midcom_error $e) {
62 64
             $e->log();
63 65
             return null;
64 66
         }
Please login to merge, or discard this patch.
lib/org/openpsa/reports/handler/projects/report.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -123,7 +123,8 @@
 block discarded – undo
123 123
             $row = [];
124 124
             try {
125 125
                 $row['person'] = org_openpsa_contacts_person_dba::get_cached($hour->person);
126
-            } catch (midcom_error $e) {
126
+            }
127
+            catch (midcom_error $e) {
127 128
                 $e->log();
128 129
                 continue;
129 130
             }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
         $qb_hr = org_openpsa_expenses_hour_report_dba::new_query_builder();
44 44
         $qb_hr->add_constraint('date', '<=', (int) $this->_request_data['query_data']['end']);
45 45
         $qb_hr->add_constraint('date', '>=', (int) $this->_request_data['query_data']['start']);
46
-        if (   array_key_exists('invoiceable_filter', $this->_request_data['query_data'])
46
+        if (array_key_exists('invoiceable_filter', $this->_request_data['query_data'])
47 47
             && $this->_request_data['query_data']['invoiceable_filter'] != -1) {
48 48
             $qb_hr->add_constraint('invoiceable', '=', (bool) $this->_request_data['query_data']['invoiceable_filter']);
49 49
         }
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
             $tasks = $this->_expand_task($this->_request_data['query_data']['task']);
59 59
             $qb_hr->add_constraint('task', 'IN', $tasks);
60 60
         }
61
-        if (   array_key_exists('hour_type_filter', $this->_request_data['query_data'])
61
+        if (array_key_exists('hour_type_filter', $this->_request_data['query_data'])
62 62
             && $this->_request_data['query_data']['hour_type_filter'] != 'builtin:all') {
63 63
             $qb_hr->add_constraint('reportType', '=', $this->_request_data['query_data']['hour_type_filter']);
64 64
         }
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 
147 147
     private function add_to_group(array $new_row, string $matching, string $sort, string $title)
148 148
     {
149
-        $rows =& $this->_request_data['report']['rows'];
149
+        $rows = & $this->_request_data['report']['rows'];
150 150
         if (array_key_exists($matching, $rows)) {
151 151
             $rows[$matching]['rows'][] = $new_row;
152 152
             $rows[$matching]['total_hours'] += $new_row['hour']->hours;
Please login to merge, or discard this patch.
lib/org/openpsa/directmarketing/sender.php 2 patches
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -222,7 +222,8 @@  discard block
 block discarded – undo
222 222
             $this->_backend->send($person, $member, $token, $subject, $content, $from);
223 223
             self::$_messages_sent++;
224 224
             $status = org_openpsa_directmarketing_campaign_messagereceipt_dba::SENT;
225
-        } catch (midcom_error $e) {
225
+        }
226
+        catch (midcom_error $e) {
226 227
             $status = org_openpsa_directmarketing_campaign_messagereceipt_dba::FAILURE;
227 228
             if (!$this->test_mode) {
228 229
                 $params[] = [
@@ -279,7 +280,8 @@  discard block
 block discarded – undo
279 280
     {
280 281
         try {
281 282
             $person = org_openpsa_contacts_person_dba::get_cached($member->person);
282
-        } catch (midcom_error $e) {
283
+        }
284
+        catch (midcom_error $e) {
283 285
             debug_add("Person #{$member->person} deleted or missing, removing member (member #{$member->id})");
284 286
             $member->orgOpenpsaObtype = org_openpsa_directmarketing_campaign_member_dba::UNSUBSCRIBED;
285 287
             $member->delete();
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
         $this->from = $from;
80 80
         $this->subject = $subject;
81 81
 
82
-        if (   $this->_message->orgOpenpsaObtype != org_openpsa_directmarketing_campaign_message_dba::EMAIL_TEXT
82
+        if ($this->_message->orgOpenpsaObtype != org_openpsa_directmarketing_campaign_message_dba::EMAIL_TEXT
83 83
             && $this->_message->orgOpenpsaObtype != org_openpsa_directmarketing_campaign_message_dba::EMAIL_HTML) {
84 84
             throw new midcom_error('unsupported message type');
85 85
         }
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
         $token .= midcom_helper_misc::random_string($this->token_size - 1, 'abcdefghijklmnopqrstuvwxyz0123456789');
224 224
 
225 225
         //If token is not free or (very, very unlikely) matches our dummy token, recurse.
226
-        if (   $token === 'dummy'
226
+        if ($token === 'dummy'
227 227
             || !org_openpsa_directmarketing_campaign_messagereceipt_dba::token_is_free($token)) {
228 228
             return $this->_create_token();
229 229
         }
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
             return null;
248 248
         }
249 249
         $type = $this->_backend->get_type();
250
-        if (   $person->get_parameter('org.openpsa.directmarketing', "send_all_denied")
250
+        if ($person->get_parameter('org.openpsa.directmarketing', "send_all_denied")
251 251
             || $person->get_parameter('org.openpsa.directmarketing', "send_{$type}_denied")) {
252 252
             debug_add("Sending {$type} messages to person {$person->rname} is denied, unsubscribing member (member #{$member->id})");
253 253
             $member->orgOpenpsaObtype = org_openpsa_directmarketing_campaign_member_dba::UNSUBSCRIBED;
Please login to merge, or discard this patch.
lib/net/nemein/rss/handler/admin.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
         }
83 83
 
84 84
         // OPML subscription list import support
85
-        if (   array_key_exists('net_nemein_rss_manage_opml', $_FILES)
85
+        if (array_key_exists('net_nemein_rss_manage_opml', $_FILES)
86 86
             && is_uploaded_file($_FILES['net_nemein_rss_manage_opml']['tmp_name'])) {
87 87
             $opml_file = $_FILES['net_nemein_rss_manage_opml']['tmp_name'];
88 88
 
Please login to merge, or discard this patch.
src/midcom/datamanager/datamanager.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -210,8 +210,7 @@
 block discarded – undo
210 210
     {
211 211
         $ret = [];
212 212
 
213
-        foreach ($this->storage as $field => $value)
214
-        {
213
+        foreach ($this->storage as $field => $value) {
215 214
             $ret[$field] = $value->get_value();
216 215
             $config = $this->schema->get_field($field);
217 216
             if (!empty($config['type_config']['allow_multiple'])) {
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 
74 74
     public function set_storage(midcom_core_dbaobject $storage = null, string $schemaname = null) : self
75 75
     {
76
-        if (   $schemaname === null
76
+        if ($schemaname === null
77 77
             && !empty($storage->id)) {
78 78
             $schemaname = $storage->get_parameter('midcom.helper.datamanager2', 'schema_name');
79 79
         }
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
         }
165 165
         $name = $this->get_name($name);
166 166
 
167
-        if (   $this->form === null
167
+        if ($this->form === null
168 168
             || $this->form->getName() != $name) {
169 169
             $this->build_form($this->get_builder($name));
170 170
         }
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
     {
262 262
         $ret = true;
263 263
         foreach ($this->storage as $field) {
264
-            if (   $field instanceof recreateable
264
+            if ($field instanceof recreateable
265 265
                 && !$field->recreate()) {
266 266
                 $ret = false;
267 267
             }
Please login to merge, or discard this patch.
lib/org/openpsa/contacts/handler/group/create.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@
 block discarded – undo
72 72
 
73 73
         $this->_group = new org_openpsa_contacts_group_dba();
74 74
 
75
-        if (   $this->_type == 'organization'
75
+        if ($this->_type == 'organization'
76 76
             && $this->_parent_group) {
77 77
             $this->_group->owner = $this->_parent_group->id;
78 78
         } else {
Please login to merge, or discard this patch.