Passed
Push — master ( fded30...46d268 )
by Andreas
03:37
created
src/api/user.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 
65 65
     private function load_by_properties(array $properties)
66 66
     {
67
-        if (   !array_key_exists('authtype', $properties)
67
+        if (!array_key_exists('authtype', $properties)
68 68
             || !array_key_exists('login', $properties)) {
69 69
             throw exception::invalid_property_value();
70 70
         }
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 
108 108
     public function &get_person() : person
109 109
     {
110
-        if (   $this->person_object === null
110
+        if ($this->person_object === null
111 111
             && $this->person !== null) {
112 112
             $this->person_object = connection::get_em()->getRepository(connection::get_fqcn('midgard_person'))->findOneBy(['guid' => $this->person]);
113 113
         }
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 
117 117
     public function create() : bool
118 118
     {
119
-        if (   empty($this->authtype)
119
+        if (empty($this->authtype)
120 120
             || !empty($this->id)) {
121 121
             exception::invalid_property_value();
122 122
             return false;
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 
181 181
     protected function is_unique() : bool
182 182
     {
183
-        if (   empty($this->login)
183
+        if (empty($this->login)
184 184
             || empty($this->authtype)) {
185 185
             return true;
186 186
         }
Please login to merge, or discard this patch.
src/storage/subscriber.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -107,8 +107,8 @@  discard block
 block discarded – undo
107 107
             $cs = $em->getUnitOfWork()->getEntityChangeSet($entity);
108 108
             // We only need to update repligard if we're coming from create (revision 0)
109 109
             // or if we delete/undelete
110
-            if (   !array_key_exists('metadata_deleted', $cs)
111
-                && $entity->metadata_revision > 0)  {
110
+            if (!array_key_exists('metadata_deleted', $cs)
111
+                && $entity->metadata_revision > 0) {
112 112
                 $check_repligard = false;
113 113
             }
114 114
 
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 
178 178
         foreach ($columns as $name => &$config) {
179 179
             if ($platform instanceof SqlitePlatform) {
180
-                if (   !empty($config['comment'])
180
+                if (!empty($config['comment'])
181 181
                     && $config['comment'] == 'BINARY') {
182 182
                     $modified = true;
183 183
                     $config['columnDefinition'] = $config['type']->getSQLDeclaration($config, $platform) . ' COLLATE BINARY' . $platform->getDefaultValueDeclarationSQL($config);
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
                         $config['columnDefinition'] = $config['comment'] . $platform->getDefaultValueDeclarationSQL($config);
195 195
                     }
196 196
                     if (!empty($config['columnDefinition']) && $platform->supportsInlineColumnComments()) {
197
-                        $config['columnDefinition'] .=  " COMMENT " . $platform->quoteStringLiteral($config['comment']);
197
+                        $config['columnDefinition'] .= " COMMENT " . $platform->quoteStringLiteral($config['comment']);
198 198
                     }
199 199
                 }
200 200
             }
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
     public function postGenerateSchemaTable(GenerateSchemaTableEventArgs $args)
279 279
     {
280 280
         $table = $args->getClassTable();
281
-        if (   !$table->hasOption('engine')
281
+        if (!$table->hasOption('engine')
282 282
             || $table->getOption('engine') !== 'MyISAM') {
283 283
             return;
284 284
         }
Please login to merge, or discard this patch.
api/midgard/replicator.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -191,19 +191,19 @@
 block discarded – undo
191 191
                 break;
192 192
         }
193 193
 
194
-        if (   $dbobject->id > 0
194
+        if ($dbobject->id > 0
195 195
             && $dbobject->metadata->revised->format('U') >= $object->metadata->revised->format('U')) {
196 196
             exception::object_imported();
197 197
             return false;
198 198
         }
199 199
 
200
-        if (   $dbobject->metadata->deleted
200
+        if ($dbobject->metadata->deleted
201 201
             && !$object->metadata->deleted) {
202 202
             if (!midgard_object_class::undelete($dbobject->guid)) {
203 203
                 return false;
204 204
             }
205 205
             $dbobject->metadata_deleted = false;
206
-        } elseif (   !$dbobject->metadata->deleted
206
+        } elseif (!$dbobject->metadata->deleted
207 207
                  && $object->metadata->deleted) {
208 208
             return $dbobject->delete();
209 209
         }
Please login to merge, or discard this patch.
src/api/mgdobject.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 
79 79
     public function __get($field)
80 80
     {
81
-        if (   $field === 'metadata'
81
+        if ($field === 'metadata'
82 82
             && $this->metadata === null
83 83
             && $this instanceof metadata_interface) {
84 84
             $this->metadata = new metadata($this);
@@ -98,13 +98,13 @@  discard block
 block discarded – undo
98 98
     protected function load_parent(array $candidates) : ?dbobject
99 99
     {
100 100
         foreach ($candidates as $candidate) {
101
-            if (   is_string($this->$candidate)
101
+            if (is_string($this->$candidate)
102 102
                 && mgd_is_guid($this->$candidate)) {
103 103
                 return \midgard_object_class::get_object_by_guid($this->$candidate);
104 104
             }
105 105
             if ($this->$candidate !== null) {
106 106
                 //Proxies become stale if the object itself is detached, so we have to re-fetch
107
-                if (   $this->$candidate instanceof Proxy
107
+                if ($this->$candidate instanceof Proxy
108 108
                     && $this->$candidate->__isInitialized()) {
109 109
                     try {
110 110
                         $this->$candidate->get_by_id($this->$candidate->id);
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
             exception::duplicate();
172 172
             return false;
173 173
         }
174
-        if (   !$this->is_unique()
174
+        if (!$this->is_unique()
175 175
             || !$this->check_parent()) {
176 176
             return false;
177 177
         }
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
             exception::invalid_property_value();
220 220
             return false;
221 221
         }
222
-        if (   $check_dependencies
222
+        if ($check_dependencies
223 223
             && $this->has_dependents()) {
224 224
             exception::has_dependants();
225 225
             return false;
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
     {
305 305
         $this->initialize();
306 306
 
307
-        if (   empty($this->cm->midgard['parentfield'])
307
+        if (empty($this->cm->midgard['parentfield'])
308 308
             || empty($this->cm->midgard['parent'])) {
309 309
             return true;
310 310
         }
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
         $this->initialize();
322 322
 
323 323
         foreach ($this->cm->fieldMappings as $name => $field) {
324
-            if (   $field['midgard:midgard_type'] == translator::TYPE_GUID
324
+            if ($field['midgard:midgard_type'] == translator::TYPE_GUID
325 325
                 && !empty($this->$name)
326 326
                 && !mgd_is_guid($this->$name)) {
327 327
                 exception::invalid_property_value("'" . $name . "' property's value is not a guid.");
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
 
334 334
     private function check_upfield() : bool
335 335
     {
336
-        if (   !empty($this->id)
336
+        if (!empty($this->id)
337 337
             && !empty($this->cm->midgard['upfield'])
338 338
             && $this->__get($this->cm->midgard['upfield']) === $this->id
339 339
             && $this->cm->getAssociationMapping($this->cm->midgard['upfield'])['targetEntity'] === $this->cm->getName()) {
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
             $stat = $results > 0;
371 371
         }
372 372
 
373
-        if (   !$stat
373
+        if (!$stat
374 374
             && !empty($this->cm->midgard['childtypes'])) {
375 375
             foreach ($this->cm->midgard['childtypes'] as $typename => $parentfield) {
376 376
                 $qb = connection::get_em()->createQueryBuilder();
@@ -679,7 +679,7 @@  discard block
 block discarded – undo
679 679
             exception::not_exists();
680 680
             return false;
681 681
         }
682
-        if (   $check_dependencies
682
+        if ($check_dependencies
683 683
             && $this->has_dependents()) {
684 684
             exception::has_dependants();
685 685
             return false;
Please login to merge, or discard this patch.