Passed
Pull Request — master (#193)
by
unknown
20:53
created
lib/org/openpsa/core/acl/synchronizer.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 {
16 16
     public function write_acls(midcom_core_dbaobject $object, $owner_id, $accesstype)
17 17
     {
18
-        if (   empty($owner_id)
18
+        if (empty($owner_id)
19 19
             || empty($accesstype)) {
20 20
             return false;
21 21
         }
@@ -63,14 +63,14 @@  discard block
 block discarded – undo
63 63
 
64 64
         if ($privileges) {
65 65
             foreach ($privileges as $privilege) {
66
-                if (   !empty($needed_privileges[$privilege->privilegename])
66
+                if (!empty($needed_privileges[$privilege->privilegename])
67 67
                     && $needed_privileges[$privilege->privilegename]['assignee'] == $privilege->assignee
68 68
                     && $needed_privileges[$privilege->privilegename]['value'] == $privilege->value) {
69 69
                     unset($needed_privileges[$privilege->privilegename]);
70 70
                     continue;
71 71
                 }
72 72
                 // Clear old ACLs applying to others than current user or selected owner group
73
-                if (   $privilege->assignee != midcom::get()->auth->user->id
73
+                if ($privilege->assignee != midcom::get()->auth->user->id
74 74
                     && $privilege->assignee != $owner_id) {
75 75
                     if (is_array($privilege->assignee)) {
76 76
                         $assignee_key = $privilege->assignee['identifier'];
Please login to merge, or discard this patch.
lib/org/openpsa/core/filter/select.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@
 block discarded – undo
77 77
             echo '<select class="filter_input" onchange="document.forms[\'' . $this->name . '_filter\'].submit();" name="' . $this->name . '">';
78 78
 
79 79
             foreach ($options as $option) {
80
-                echo '<option value="' .  $option['id'] . '"';
80
+                echo '<option value="' . $option['id'] . '"';
81 81
                 if ($option['selected'] == true) {
82 82
                     echo " selected=\"selected\"";
83 83
                 }
Please login to merge, or discard this patch.
lib/org/openpsa/core/queryfilter.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -77,9 +77,9 @@
 block discarded – undo
77 77
         $filter_id = $this->_identifier . '_' . $filtername;
78 78
         $user = midcom::get()->auth->user->get_storage();
79 79
 
80
-        if (   isset($_POST['unset_filter'])
80
+        if (isset($_POST['unset_filter'])
81 81
             && $_POST['unset_filter'] == $filter_id) {
82
-            if (   $user->get_parameter("org_openpsa_core_filter", $filter_id)
82
+            if ($user->get_parameter("org_openpsa_core_filter", $filter_id)
83 83
                 && !$user->delete_parameter("org_openpsa_core_filter", $filter_id)) {
84 84
                 $message_content = sprintf(
85 85
                     $l10n->get('the handed filter for %s could not be set as parameter'),
Please login to merge, or discard this patch.
lib/org/openpsa/contacts/duplicates/merge.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
      */
46 46
     public function merge($obj1, $obj2, $merge_mode)
47 47
     {
48
-        if (   $merge_mode !== 'all'
48
+        if ($merge_mode !== 'all'
49 49
             && $merge_mode !== 'future') {
50 50
             debug_add("invalid mode {$merge_mode}", MIDCOM_LOG_ERROR);
51 51
             throw new midcom_error('invalid merge mode');
@@ -87,9 +87,9 @@  discard block
 block discarded – undo
87 87
                         if (!empty($conf['duplicate_check'])) {
88 88
                             $dup = $this->check_duplicate($results, $result, $conf['duplicate_check']);
89 89
 
90
-                            if (   is_object($dup)
90
+                            if (is_object($dup)
91 91
                                 || $dup === false) {
92
-                                if (   !is_object($dup)
92
+                                if (!is_object($dup)
93 93
                                     || !array_key_exists($dup->id, $todelete)) {
94 94
                                     $todelete[$result->id] = $result;
95 95
                                 }
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
                         }
99 99
                     }
100 100
                 }
101
-                if (   $needs_update
101
+                if ($needs_update
102 102
                     && !$result->update()) {
103 103
                     throw new midcom_error("Failed to update {$classname} #{$result->id}, errstr: " . midcom_connection::get_error_string());
104 104
                 }
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
         }
148 148
 
149 149
         foreach ($results as $result) {
150
-            if (   $result->$field === $object->$field
150
+            if ($result->$field === $object->$field
151 151
                 && $result->id !== $object->id) {
152 152
                 return $result;
153 153
             }
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
         $changed = false;
166 166
         foreach ($person2 as $property => $value) {
167 167
             // Copy only simple properties not marked to be skipped missing from person1
168
-            if (   empty($person2->$property)
168
+            if (empty($person2->$property)
169 169
                 || !empty($person1->$property)
170 170
                 || isset($skip_properties[$property])
171 171
                 || !is_scalar($value)) {
Please login to merge, or discard this patch.
lib/org/openpsa/contacts/group.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 
32 32
     public function __set($name, $value)
33 33
     {
34
-        if (   $name == 'homepage'
34
+        if ($name == 'homepage'
35 35
             && !empty($value)
36 36
             && $value != $this->homepage) {
37 37
             $this->_register_prober = true;
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 
78 78
     public function __get($property)
79 79
     {
80
-        if (   $property == 'invoice_label'
80
+        if ($property == 'invoice_label'
81 81
             || $property == 'postal_label') {
82 82
             if (!isset($this->_address_extras[$property])) {
83 83
                 $this->_get_address_extra($property);
Please login to merge, or discard this patch.
lib/org/openpsa/contacts/person.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 
23 23
     public function __construct($identifier = null)
24 24
     {
25
-        if (   midcom::get()->config->get('person_class') != 'midgard_person'
25
+        if (midcom::get()->config->get('person_class') != 'midgard_person'
26 26
             && midcom::get()->config->get('person_class') != 'openpsa_person') {
27 27
             $this->__mgdschema_class_name__ = midcom::get()->config->get('person_class');
28 28
         }
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 
32 32
     public function __set($name, $value)
33 33
     {
34
-        if (   $name == 'homepage'
34
+        if ($name == 'homepage'
35 35
             && !empty($value)
36 36
             && $value != $this->homepage) {
37 37
             $this->_url_changed = true;
Please login to merge, or discard this patch.
lib/org/openpsa/qbpager/main.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -61,16 +61,16 @@  discard block
 block discarded – undo
61 61
     private function _check_page_vars()
62 62
     {
63 63
         $page_var = $this->_prefix . 'page';
64
-        $results_var =  $this->_prefix . 'results';
64
+        $results_var = $this->_prefix . 'results';
65 65
         if (!empty($_REQUEST[$page_var])) {
66 66
             debug_add("{$page_var} has value: {$_REQUEST[$page_var]}");
67
-            $this->_current_page = (int)$_REQUEST[$page_var];
67
+            $this->_current_page = (int) $_REQUEST[$page_var];
68 68
         }
69 69
         if (!empty($_REQUEST[$results_var])) {
70 70
             debug_add("{$results_var} has value: {$_REQUEST[$results_var]}");
71
-            $this->results_per_page = (int)$_REQUEST[$results_var];
71
+            $this->results_per_page = (int) $_REQUEST[$results_var];
72 72
         }
73
-        $this->_offset = ($this->_current_page-1)*$this->results_per_page;
73
+        $this->_offset = ($this->_current_page - 1) * $this->results_per_page;
74 74
         if ($this->_offset < 0) {
75 75
             $this->_offset = 0;
76 76
         }
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
         return $this->_midcom_qb->add_constraint($param, $op, $val);
293 293
     }
294 294
 
295
-    public function add_order($param, $sort='ASC')
295
+    public function add_order($param, $sort = 'ASC')
296 296
     {
297 297
         if (!$this->_sanity_check()) {
298 298
             return false;
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
         if (!$this->_sanity_check()) {
330 330
             return false;
331 331
         }
332
-        if (   !$this->count
332
+        if (!$this->count
333 333
             || $this->_count_mode != 'count') {
334 334
             $this->count = $this->_midcom_qb_count->count();
335 335
         }
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
         if (!$this->_sanity_check()) {
343 343
             return false;
344 344
         }
345
-        if (   !$this->count
345
+        if (!$this->count
346 346
             || $this->_count_mode != 'count_unchecked') {
347 347
             $this->count = $this->_midcom_qb_count->count_unchecked();
348 348
         }
Please login to merge, or discard this patch.
lib/org/openpsa/projects/handler/task/resourcing.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
         $this->_task = new org_openpsa_projects_task_dba($args[0]);
59 59
         $this->_task->require_do('midgard:create');
60 60
 
61
-        if (   array_key_exists('org_openpsa_projects_prospects', $_POST)
61
+        if (array_key_exists('org_openpsa_projects_prospects', $_POST)
62 62
             && $_POST['save']) {
63 63
             $qb = org_openpsa_projects_task_resource_dba::new_query_builder();
64 64
             $qb->add_constraint('guid', 'IN', array_keys($_POST['org_openpsa_projects_prospects']));
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
                     // create relatedto
90 90
                     org_openpsa_relatedto_plugin::create($event, 'org.openpsa.calendar', $this->_task, 'org.openpsa.projects');
91 91
                 }
92
-                if (   $update_prospect
92
+                if ($update_prospect
93 93
                     && !$prospect->update()) {
94 94
                     debug_add('Failed to update prospect: ' . midcom_connection::get_error_string(), MIDCOM_LOG_ERROR);
95 95
                 }
Please login to merge, or discard this patch.
lib/org/openpsa/projects/task/status.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@
 block discarded – undo
63 63
     public function _on_created()
64 64
     {
65 65
         //Remove the resource if necessary
66
-        if (   $this->type == self::DECLINED
66
+        if ($this->type == self::DECLINED
67 67
             && $this->targetPerson) {
68 68
             $qb = org_openpsa_projects_task_resource_dba::new_query_builder();
69 69
             $qb->add_constraint('task', '=', $this->task);
Please login to merge, or discard this patch.