Passed
Branch master (95796a)
by Andreas
38:22
created
lib/org/routamc/positioning/aerodrome.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
      */
46 46
     public function _on_creating()
47 47
     {
48
-        if (   $this->longitude
48
+        if ($this->longitude
49 49
             && $this->latitude)
50 50
         {
51 51
             $qb = org_routamc_positioning_aerodrome_dba::new_query_builder();
Please login to merge, or discard this patch.
lib/org/routamc/positioning/location.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@
 block discarded – undo
79 79
      */
80 80
     public function _on_created()
81 81
     {
82
-        if (   !$this->log
82
+        if (!$this->log
83 83
             && $this->relation == self::RELATION_IN)
84 84
         {
85 85
             // This location entry is defined as being made in a location,
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,8 +34,7 @@
 block discarded – undo
34 34
                 if (isset($parent->title))
35 35
                 {
36 36
                     $label = $parent->title;
37
-                }
38
-                elseif (method_exists($parent, 'get_label'))
37
+                } elseif (method_exists($parent, 'get_label'))
39 38
                 {
40 39
                     $label = $parent->get_label();
41 40
                 }
Please login to merge, or discard this patch.
lib/org/routamc/positioning/user.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 {
47 47
     static public function set_location(array $location)
48 48
     {
49
-        if (   !isset($location['latitude'])
49
+        if (!isset($location['latitude'])
50 50
             || !isset($location['longitude']))
51 51
         {
52 52
             throw new InvalidArgumentException('No coordinates provided');
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 
66 66
     static public function set_location_for_person(array $location, midcom_db_person $person)
67 67
     {
68
-        if (   !isset($location['latitude'])
68
+        if (!isset($location['latitude'])
69 69
             || !isset($location['longitude']))
70 70
         {
71 71
             throw new InvalidArgumentException('No coordinates provided');
Please login to merge, or discard this patch.
lib/org/routamc/positioning/country.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
     public function _on_creating()
31 31
     {
32 32
         $qb = org_routamc_positioning_country_dba::new_query_builder();
33
-        $qb->add_constraint('name', '=', (string)$this->name);
33
+        $qb->add_constraint('name', '=', (string) $this->name);
34 34
         $qb->set_limit(1);
35 35
         $matches = $qb->execute_unchecked();
36 36
         if (count($matches) > 0)
Please login to merge, or discard this patch.
lib/org/routamc/positioning/person.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
      */
52 52
     function seek_log($time = null)
53 53
     {
54
-        if (   is_null($this->_person)
54
+        if (is_null($this->_person)
55 55
             || !$this->_person->id)
56 56
         {
57 57
             return null;
Please login to merge, or discard this patch.
lib/org/openpsa/contacts/handler/group/view.php 2 patches
Spacing   +8 added lines, -14 removed lines patch added patch discarded remove patch
@@ -42,30 +42,25 @@  discard block
 block discarded – undo
42 42
         $buttons = array();
43 43
         if ($this->_group->can_do('midgard:update'))
44 44
         {
45
-            $buttons = array
46
-            (
47
-                $workflow->get_button("group/edit/{$this->_group->guid}/", array
48
-                (
45
+            $buttons = array(
46
+                $workflow->get_button("group/edit/{$this->_group->guid}/", array(
49 47
                     MIDCOM_TOOLBAR_ACCESSKEY => 'e',
50 48
                 )),
51
-                $workflow->get_button("group/create/organization/{$this->_group->guid}/", array
52
-                (
49
+                $workflow->get_button("group/create/organization/{$this->_group->guid}/", array(
53 50
                     MIDCOM_TOOLBAR_LABEL => $this->_l10n->get('create suborganization'),
54 51
                     MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/stock_people-new.png',
55 52
                 )),
56
-                $workflow->get_button("group/create/group/{$this->_group->guid}/", array
57
-                (
53
+                $workflow->get_button("group/create/group/{$this->_group->guid}/", array(
58 54
                     MIDCOM_TOOLBAR_LABEL => $this->_l10n->get('create subgroup'),
59 55
                     MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/stock_people-new.png',
60 56
                 ))
61 57
             );
62 58
         }
63 59
 
64
-        if (   midcom::get()->auth->can_user_do('midgard:create', null, 'org_openpsa_contacts_person_dba')
60
+        if (midcom::get()->auth->can_user_do('midgard:create', null, 'org_openpsa_contacts_person_dba')
65 61
             && $this->_group->can_do('midgard:create'))
66 62
         {
67
-            $buttons[] = $workflow->get_button("person/create/{$this->_group->guid}/", array
68
-            (
63
+            $buttons[] = $workflow->get_button("person/create/{$this->_group->guid}/", array(
69 64
                 MIDCOM_TOOLBAR_LABEL => $this->_l10n->get('create person'),
70 65
                 MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/stock_person-new.png',
71 66
             ));
@@ -73,11 +68,10 @@  discard block
 block discarded – undo
73 68
 
74 69
         $siteconfig = org_openpsa_core_siteconfig::get_instance();
75 70
         $user_url = $siteconfig->get_node_full_url('org.openpsa.user');
76
-        if (   $user_url
71
+        if ($user_url
77 72
             && midcom::get()->auth->can_user_do('org.openpsa.user:access', null, 'org_openpsa_user_interface'))
78 73
         {
79
-            $buttons[] = array
80
-            (
74
+            $buttons[] = array(
81 75
                 MIDCOM_TOOLBAR_URL => $user_url . "group/{$this->_group->guid}/",
82 76
                 MIDCOM_TOOLBAR_LABEL => $this->_i18n->get_string('user management', 'org.openpsa.user'),
83 77
                 MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/properties.png',
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -57,8 +57,7 @@  discard block
 block discarded – undo
57 57
             // This is the root node
58 58
             $node_identifier = '';
59 59
             $nodes['/'] = $node;
60
-        }
61
-        else
60
+        } else
62 61
         {
63 62
             $node_identifier = $prefix . trim($node[MIDCOM_NAV_URL], '/');
64 63
             $nodes[$node_identifier] = $node;
@@ -112,8 +111,7 @@  discard block
 block discarded – undo
112 111
             // The linked page is in same namespace
113 112
             $nap = new midcom_helper_nav();
114 113
             $folder = $nap->get_node($this->_topic);
115
-        }
116
-        else
114
+        } else
117 115
         {
118 116
             $folder = $this->resolve_namespaces($path, $matches, $levels, $force_resolve_folder_tree, $force_as_root);
119 117
         }
@@ -128,8 +126,7 @@  discard block
 block discarded – undo
128 126
             if (count($wikipages) == 1)
129 127
             {
130 128
                 $matches['wikipage'] = $wikipages[0];
131
-            }
132
-            else
129
+            } else
133 130
             {
134 131
                 // No page found, go to create
135 132
                 $matches['folder'] = $folder;
Please login to merge, or discard this patch.
lib/org/openpsa/contacts/handler/group/create.php 2 patches
Spacing   +3 added lines, -4 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
     {
75 75
         $this->_group = new org_openpsa_contacts_group_dba();
76 76
 
77
-        if (   $this->_type == 'organization'
77
+        if ($this->_type == 'organization'
78 78
             && $this->_parent_group)
79 79
         {
80 80
             $this->_group->owner = (int) $this->_parent_group->id;
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
         }
87 87
         $this->_group->name = time();
88 88
 
89
-        if (! $this->_group->create())
89
+        if (!$this->_group->create())
90 90
         {
91 91
             debug_print_r('We operated on this object:', $this->_group);
92 92
             throw new midcom_error("Failed to create a new group. Error: " . midcom_connection::get_error_string());
@@ -119,8 +119,7 @@  discard block
 block discarded – undo
119 119
 
120 120
         midcom::get()->head->set_pagetitle(sprintf($this->_l10n_midcom->get('create %s'), $this->_l10n->get($this->_type)));
121 121
 
122
-        $workflow = $this->get_workflow('datamanager2', array
123
-        (
122
+        $workflow = $this->get_workflow('datamanager2', array(
124 123
             'controller' => $this->get_controller('create'),
125 124
             'save_callback' => array($this, 'save_callback')
126 125
         ));
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -43,8 +43,7 @@  discard block
 block discarded – undo
43 43
                  * this group id
44 44
                  */
45 45
                 $product_qb->add_constraint('productGroup', 'INTREE', $groups[0]->id);
46
-            }
47
-            else
46
+            } else
48 47
             {
49 48
                 $product_qb->add_constraint('productGroup', 'IN', $categories);
50 49
             }
@@ -80,8 +79,7 @@  discard block
 block discarded – undo
80 79
         {
81 80
             $product_group = $args[0];
82 81
             $show_products = (int) $args[1];
83
-        }
84
-        else
82
+        } else
85 83
         {
86 84
             $show_products = (int) $args[0];
87 85
             $product_group = '';
@@ -147,8 +145,7 @@  discard block
 block discarded – undo
147 145
         if ($handler_id == 'updated_products_feed_intree')
148 146
         {
149 147
             $this->_list_products($this->_config->get('show_items_in_feed'), $args[0]);
150
-        }
151
-        else
148
+        } else
152 149
         {
153 150
             $this->_list_products($this->_config->get('show_items_in_feed'));
154 151
         }
Please login to merge, or discard this patch.
lib/org/openpsa/contacts/handler/search.php 2 patches
Spacing   +10 added lines, -15 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 
83 83
         // Handle automatic wildcards
84 84
         $auto_wildcards = $this->_config->get('auto_wildcards');
85
-        if (   $auto_wildcards
85
+        if ($auto_wildcards
86 86
             && strpos($this->_query_string_processed, '%') === false)
87 87
         {
88 88
             switch ($auto_wildcards)
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
      */
133 133
     public function _show_search_type($handler_id, array &$data)
134 134
     {
135
-        if (   $this->_view == 'foaf'
135
+        if ($this->_view == 'foaf'
136 136
             && sizeof($this->_persons) > 0)
137 137
         {
138 138
             midcom_show_style('foaf-header');
@@ -169,12 +169,12 @@  discard block
 block discarded – undo
169 169
             return $this->_prepare_json_reply();
170 170
         }
171 171
 
172
-        if (   count($this->_groups) == 1
172
+        if (count($this->_groups) == 1
173 173
             && count($this->_persons) == 0)
174 174
         {
175 175
             return new midcom_response_relocate('group/' . $this->_groups[0]->guid . '/');
176 176
         }
177
-        if (   count($this->_groups) == 0
177
+        if (count($this->_groups) == 0
178 178
             && count($this->_persons) == 1)
179 179
         {
180 180
             return new midcom_response_relocate('person/' . $this->_persons[0]->guid . '/');
@@ -193,8 +193,7 @@  discard block
 block discarded – undo
193 193
         $data = array();
194 194
         foreach ($this->_persons as $person)
195 195
         {
196
-            $data[] = array
197
-            (
196
+            $data[] = array(
198 197
                 'category' => $this->_l10n->get('persons'),
199 198
                 'label' => $person->get_label(),
200 199
                 'value' => $person->get_label(),
@@ -203,8 +202,7 @@  discard block
 block discarded – undo
203 202
         }
204 203
         foreach ($this->_groups as $group)
205 204
         {
206
-            $data[] = array
207
-            (
205
+            $data[] = array(
208 206
                 'category' => $this->_l10n->get('groups'),
209 207
                 'label' => $group->get_label(),
210 208
                 'value' => $group->get_label(),
@@ -222,21 +220,18 @@  discard block
 block discarded – undo
222 220
         $buttons = array();
223 221
         if (midcom::get()->auth->can_user_do('midgard:create', null, 'org_openpsa_contacts_person_dba'))
224 222
         {
225
-            $buttons[] = $workflow->get_button('person/create/', array
226
-            (
223
+            $buttons[] = $workflow->get_button('person/create/', array(
227 224
                 MIDCOM_TOOLBAR_LABEL => $this->_l10n->get('create person'),
228 225
                 MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/stock_person-new.png',
229 226
             ));
230 227
         }
231 228
         if (midcom::get()->auth->can_user_do('midgard:create', null, 'org_openpsa_contacts_group_dba'))
232 229
         {
233
-            $buttons[] = $workflow->get_button('group/create/organization/', array
234
-            (
230
+            $buttons[] = $workflow->get_button('group/create/organization/', array(
235 231
                 MIDCOM_TOOLBAR_LABEL => $this->_l10n->get('create organization'),
236 232
                 MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/stock_people-new.png',
237 233
             ));
238
-            $buttons[] = $workflow->get_button('group/create/group/', array
239
-            (
234
+            $buttons[] = $workflow->get_button('group/create/group/', array(
240 235
                 MIDCOM_TOOLBAR_LABEL => sprintf($this->_l10n_midcom->get('create %s'), $this->_l10n->get('group')),
241 236
                 MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/stock_people-new.png',
242 237
             ));
@@ -259,7 +254,7 @@  discard block
 block discarded – undo
259 254
 
260 255
         midcom_show_style('search-header');
261 256
 
262
-        if (   count($this->_groups) == 0
257
+        if (count($this->_groups) == 0
263 258
             && count($this->_persons) == 0
264 259
             && $this->_query_string)
265 260
         {
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/org/openpsa/contacts/handler/person/view.php 2 patches
Spacing   +11 added lines, -18 removed lines patch added patch discarded remove patch
@@ -72,10 +72,8 @@  discard block
 block discarded – undo
72 72
         if ($data['person_rss_url'])
73 73
         {
74 74
             // We've autoprobed that this contact has a RSS feed available, link it
75
-            midcom::get()->head->add_link_head
76
-            (
77
-                array
78
-                (
75
+            midcom::get()->head->add_link_head(
76
+                array(
79 77
                     'rel'   => 'alternate',
80 78
                     'type'  => 'application/rss+xml',
81 79
                     'title' => sprintf($this->_l10n->get('rss feed of person %s'), $this->_contact->name),
@@ -105,8 +103,7 @@  discard block
 block discarded – undo
105 103
         $buttons = array();
106 104
         if ($this->_contact->can_do('midgard:update'))
107 105
         {
108
-            $buttons[] = $workflow->get_button("person/edit/{$this->_contact->guid}/", array
109
-            (
106
+            $buttons[] = $workflow->get_button("person/edit/{$this->_contact->guid}/", array(
110 107
                 MIDCOM_TOOLBAR_ACCESSKEY => 'e',
111 108
             ));
112 109
         }
@@ -115,24 +112,22 @@  discard block
 block discarded – undo
115 112
         $invoices_url = $siteconfig->get_node_full_url('org.openpsa.invoices');
116 113
         $user_url = $siteconfig->get_node_full_url('org.openpsa.user');
117 114
 
118
-        if (   $invoices_url
115
+        if ($invoices_url
119 116
             && midcom::get()->auth->can_user_do('midgard:create', null, 'org_openpsa_invoices_invoice_dba'))
120 117
         {
121 118
             if ($this->_contact->can_do('midgard:update'))
122 119
             {
123
-                $buttons[] = $workflow->get_button($invoices_url . "billingdata/" . $this->_contact->guid . '/', array
124
-                (
120
+                $buttons[] = $workflow->get_button($invoices_url . "billingdata/" . $this->_contact->guid . '/', array(
125 121
                     MIDCOM_TOOLBAR_LABEL => $this->_l10n->get('edit billingdata'),
126 122
                 ));
127 123
             }
128 124
         }
129 125
 
130
-        if (   $user_url
131
-            && (   midcom_connection::get_user() == $this->_contact->id
126
+        if ($user_url
127
+            && (midcom_connection::get_user() == $this->_contact->id
132 128
                 || midcom::get()->auth->can_user_do('org.openpsa.user:access', null, 'org_openpsa_user_interface')))
133 129
         {
134
-            $buttons[] = array
135
-            (
130
+            $buttons[] = array(
136 131
                 MIDCOM_TOOLBAR_URL => $user_url . "view/{$this->_contact->guid}/",
137 132
                 MIDCOM_TOOLBAR_LABEL => $this->_i18n->get_string('user management', 'org.openpsa.user'),
138 133
                 MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/properties.png',
@@ -150,8 +145,7 @@  discard block
 block discarded – undo
150 145
         if ($mycontacts->is_member($this->_contact->guid))
151 146
         {
152 147
             // We're buddies, show remove button
153
-            $buttons[] = array
154
-            (
148
+            $buttons[] = array(
155 149
                 MIDCOM_TOOLBAR_URL => "mycontacts/remove/{$this->_contact->guid}/",
156 150
                 MIDCOM_TOOLBAR_LABEL => $this->_l10n->get('remove from my contacts'),
157 151
                 MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/trash.png',
@@ -160,8 +154,7 @@  discard block
 block discarded – undo
160 154
         else
161 155
         {
162 156
             // We're not buddies, show add button
163
-            $buttons[] = array
164
-            (
157
+            $buttons[] = array(
165 158
                 MIDCOM_TOOLBAR_URL => "mycontacts/add/{$this->_contact->guid}/",
166 159
                 MIDCOM_TOOLBAR_LABEL => $this->_l10n->get('add to my contacts'),
167 160
                 MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/stock_person.png',
@@ -215,7 +208,7 @@  discard block
 block discarded – undo
215 208
     public function _show_group_memberships($handler_id, array &$data)
216 209
     {
217 210
         // This is most likely a dynamic_load
218
-        if (   count($data['organizations']) == 0
211
+        if (count($data['organizations']) == 0
219 212
             && count($data['groups']) == 0)
220 213
         {
221 214
             midcom_show_style('show-person-groups-empty');
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -156,8 +156,7 @@  discard block
 block discarded – undo
156 156
                 MIDCOM_TOOLBAR_LABEL => $this->_l10n->get('remove from my contacts'),
157 157
                 MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/trash.png',
158 158
             );
159
-        }
160
-        else
159
+        } else
161 160
         {
162 161
             // We're not buddies, show add button
163 162
             $buttons[] = array
@@ -220,8 +219,7 @@  discard block
 block discarded – undo
220 219
         {
221 220
             midcom_show_style('show-person-groups-empty');
222 221
 
223
-        }
224
-        else
222
+        } else
225 223
         {
226 224
             $this->_show_memberships('organizations');
227 225
             $this->_show_memberships('groups');
@@ -241,8 +239,7 @@  discard block
 block discarded – undo
241 239
             try
242 240
             {
243 241
                 $this->_request_data['group'] = org_openpsa_contacts_group_dba::get_cached($member->gid);
244
-            }
245
-            catch (midcom_error $e)
242
+            } catch (midcom_error $e)
246 243
             {
247 244
                 $e->log();
248 245
                 continue;
Please login to merge, or discard this patch.