Passed
Push — master ( b76ebc...8c22e9 )
by Andreas
03:28
created
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);
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
         foreach ($candidates as $candidate) {
101 101
             if ($this->$candidate !== null) {
102 102
                 //Proxies become stale if the object itself is detached, so we have to re-fetch
103
-                if (   $this->$candidate instanceof Proxy
103
+                if ($this->$candidate instanceof Proxy
104 104
                     && $this->$candidate->__isInitialized()) {
105 105
                     try {
106 106
                         $this->$candidate->get_by_id($this->$candidate->id);
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
         }
129 129
         // According to Doctrine documentation, proxies should be transparent, but in practice,
130 130
         // there will be problems if we don't force-load
131
-        if (   $entity instanceof Proxy
131
+        if ($entity instanceof Proxy
132 132
             && !$entity->__isInitialized()) {
133 133
             try {
134 134
                 $entity->__load();
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
             exception::duplicate();
182 182
             return false;
183 183
         }
184
-        if (   !$this->is_unique()
184
+        if (!$this->is_unique()
185 185
             || !$this->check_parent()) {
186 186
             return false;
187 187
         }
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
             midgard_connection::get_instance()->set_error(MGD_ERR_INVALID_PROPERTY_VALUE);
238 238
             return false;
239 239
         }
240
-        if (   $check_dependencies
240
+        if ($check_dependencies
241 241
             && $this->has_dependents()) {
242 242
             exception::has_dependants();
243 243
             return false;
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
     {
329 329
         $this->initialize();
330 330
 
331
-        if (   empty($this->cm->midgard['parentfield'])
331
+        if (empty($this->cm->midgard['parentfield'])
332 332
             || empty($this->cm->midgard['parent'])) {
333 333
             return true;
334 334
         }
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
         $this->initialize();
346 346
 
347 347
         foreach ($this->cm->fieldMappings as $name => $field) {
348
-            if (   $field['midgard:midgard_type'] == translator::TYPE_GUID
348
+            if ($field['midgard:midgard_type'] == translator::TYPE_GUID
349 349
                 && !empty($this->$name)
350 350
                 && !mgd_is_guid($this->$name)) {
351 351
                 exception::invalid_property_value("'" . $name . "' property's value is not a guid.");
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
 
358 358
     private function check_upfield() : bool
359 359
     {
360
-        if (   !empty($this->id)
360
+        if (!empty($this->id)
361 361
             && !empty($this->cm->midgard['upfield'])
362 362
             && $this->__get($this->cm->midgard['upfield']) === $this->id
363 363
             && $this->cm->getAssociationMapping($this->cm->midgard['upfield'])['targetEntity'] === $this->cm->getName()) {
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
             $stat = $results > 0;
395 395
         }
396 396
 
397
-        if (   !$stat
397
+        if (!$stat
398 398
             && !empty($this->cm->midgard['childtypes'])) {
399 399
             foreach ($this->cm->midgard['childtypes'] as $typename => $parentfield) {
400 400
                 $qb = connection::get_em()->createQueryBuilder();
@@ -743,7 +743,7 @@  discard block
 block discarded – undo
743 743
             exception::not_exists();
744 744
             return false;
745 745
         }
746
-        if (   $check_dependencies
746
+        if ($check_dependencies
747 747
             && $this->has_dependents()) {
748 748
             exception::has_dependants();
749 749
             return false;
Please login to merge, or discard this patch.