Test Failed
Branch master (e0a8c8)
by Andreas
11:33
created
src/api/dbobject.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
     {
60 60
         $this->initialize();
61 61
         $properties = array_merge($this->cm->getFieldNames(), $this->cm->getAssociationNames(), array_keys($this->cm->midgard['field_aliases']));
62
-        $properties = array_filter($properties, function ($input) {
62
+        $properties = array_filter($properties, function($input) {
63 63
             return strpos($input, 'metadata_') === false;
64 64
         });
65 65
         $ret = [];
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
     {
75 75
         $this->initialize();
76 76
 
77
-        if (   !$this->cm->hasField($field)
77
+        if (!$this->cm->hasField($field)
78 78
             && isset($this->cm->midgard['field_aliases'][$field])) {
79 79
             $field = $this->cm->midgard['field_aliases'][$field];
80 80
         }
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
             if (empty($value)) {
85 85
                 $value = null;
86 86
             } else {
87
-                if (   !\is_object($this->$field)
87
+                if (!\is_object($this->$field)
88 88
                     || $this->$field->id != $value) {
89 89
                     $this->changed_associations[$field] = true;
90 90
                 }
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
         } elseif ($this->cm->hasField($field)) {
95 95
             $mapping = $this->cm->getFieldMapping($field);
96 96
 
97
-            if (   $mapping['type'] === 'string'
97
+            if ($mapping['type'] === 'string'
98 98
                 || $mapping['type'] == 'text') {
99 99
                 $value = (string) $value;
100 100
             } elseif ($mapping['type'] === 'integer') {
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
             } elseif ($mapping['type'] === 'float') {
105 105
                 $value = (float) $value;
106 106
             } elseif ($mapping['type'] === 'datetime') {
107
-                if (   \is_string($value)
107
+                if (\is_string($value)
108 108
                     && $value !== '0000-00-00 00:00:00') {
109 109
                     $value = new midgard_datetime($value);
110 110
                 } elseif (!($value instanceof midgard_datetime)) {
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
     {
121 121
         $this->initialize();
122 122
 
123
-        if (   !$this->cm->hasField($field)
123
+        if (!$this->cm->hasField($field)
124 124
             && isset($this->cm->midgard['field_aliases'][$field])) {
125 125
             $field = $this->cm->midgard['field_aliases'][$field];
126 126
         }
@@ -133,11 +133,11 @@  discard block
 block discarded – undo
133 133
             }
134 134
             return 0;
135 135
         }
136
-        if (   $this->$field === null
136
+        if ($this->$field === null
137 137
             && $this->cm->isIdentifier($field)) {
138 138
             return 0;
139 139
         }
140
-        if (   $this->$field instanceof midgard_datetime
140
+        if ($this->$field instanceof midgard_datetime
141 141
             && $this->$field->format('U') == -62169984000) {
142 142
             //This is mainly needed for working with converted Legacy databases. Midgard2 somehow handles this internally
143 143
             //@todo Find a nicer solution and research how QB handles this
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
@@ -95,8 +95,8 @@  discard block
 block discarded – undo
95 95
             $cs = $em->getUnitOfWork()->getEntityChangeSet($entity);
96 96
             // We only need to update repligard if we're coming from create (revision 0)
97 97
             // or if we delete/undelete
98
-            if (   !array_key_exists('metadata_deleted', $cs)
99
-                && $entity->metadata_revision > 0)  {
98
+            if (!array_key_exists('metadata_deleted', $cs)
99
+                && $entity->metadata_revision > 0) {
100 100
                 $check_repligard = false;
101 101
             }
102 102
 
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 
166 166
         foreach ($columns as $name => &$config) {
167 167
             if ($platform->getName() === 'sqlite') {
168
-                if (   !empty($config['comment'])
168
+                if (!empty($config['comment'])
169 169
                     && $config['comment'] == 'BINARY') {
170 170
                     $modified = true;
171 171
                     $config['columnDefinition'] = $config['type']->getSQLDeclaration($config, $platform) . ' COLLATE BINARY' . $platform->getDefaultValueDeclarationSQL($config);
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
                         $config['columnDefinition'] = $config['comment'] . $platform->getDefaultValueDeclarationSQL($config);
183 183
                     }
184 184
                     if (!empty($config['columnDefinition']) && $platform->supportsInlineColumnComments()) {
185
-                        $config['columnDefinition'] .=  " COMMENT " . $platform->quoteStringLiteral($config['comment']);
185
+                        $config['columnDefinition'] .= " COMMENT " . $platform->quoteStringLiteral($config['comment']);
186 186
                     }
187 187
                 }
188 188
             }
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
     public function postGenerateSchemaTable(GenerateSchemaTableEventArgs $args)
267 267
     {
268 268
         $table = $args->getClassTable();
269
-        if (   !$table->hasOption('engine')
269
+        if (!$table->hasOption('engine')
270 270
             || $table->getOption('engine') !== 'MyISAM') {
271 271
             return;
272 272
         }
Please login to merge, or discard this patch.
src/api/mgdobject.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 
78 78
     public function __get($field)
79 79
     {
80
-        if (   $field === 'metadata'
80
+        if ($field === 'metadata'
81 81
             && $this->metadata === null
82 82
             && $this instanceof metadata_interface) {
83 83
             $this->metadata = new metadata($this);
@@ -97,13 +97,13 @@  discard block
 block discarded – undo
97 97
     protected function load_parent(array $candidates) : ?dbobject
98 98
     {
99 99
         foreach ($candidates as $candidate) {
100
-            if (   is_string($this->$candidate)
100
+            if (is_string($this->$candidate)
101 101
                 && mgd_is_guid($this->$candidate)) {
102 102
                 return \midgard_object_class::get_object_by_guid($this->$candidate);
103 103
             }
104 104
             if ($this->$candidate !== null) {
105 105
                 //Proxies become stale if the object itself is detached, so we have to re-fetch
106
-                if (   $this->$candidate instanceof Proxy
106
+                if ($this->$candidate instanceof Proxy
107 107
                     && $this->$candidate->__isInitialized()) {
108 108
                     try {
109 109
                         $this->$candidate->get_by_id($this->$candidate->id);
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
         }
128 128
         // According to Doctrine documentation, proxies should be transparent, but in practice,
129 129
         // there will be problems if we don't force-load
130
-        if (   $entity instanceof Proxy
130
+        if ($entity instanceof Proxy
131 131
             && !$entity->__isInitialized()) {
132 132
             try {
133 133
                 $entity->__load();
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
             exception::duplicate();
174 174
             return false;
175 175
         }
176
-        if (   !$this->is_unique()
176
+        if (!$this->is_unique()
177 177
             || !$this->check_parent()) {
178 178
             return false;
179 179
         }
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
             midgard_connection::get_instance()->set_error(MGD_ERR_INVALID_PROPERTY_VALUE);
225 225
             return false;
226 226
         }
227
-        if (   $check_dependencies
227
+        if ($check_dependencies
228 228
             && $this->has_dependents()) {
229 229
             exception::has_dependants();
230 230
             return false;
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
     {
311 311
         $this->initialize();
312 312
 
313
-        if (   empty($this->cm->midgard['parentfield'])
313
+        if (empty($this->cm->midgard['parentfield'])
314 314
             || empty($this->cm->midgard['parent'])) {
315 315
             return true;
316 316
         }
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
         $this->initialize();
328 328
 
329 329
         foreach ($this->cm->fieldMappings as $name => $field) {
330
-            if (   $field['midgard:midgard_type'] == translator::TYPE_GUID
330
+            if ($field['midgard:midgard_type'] == translator::TYPE_GUID
331 331
                 && !empty($this->$name)
332 332
                 && !mgd_is_guid($this->$name)) {
333 333
                 exception::invalid_property_value("'" . $name . "' property's value is not a guid.");
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
 
340 340
     private function check_upfield() : bool
341 341
     {
342
-        if (   !empty($this->id)
342
+        if (!empty($this->id)
343 343
             && !empty($this->cm->midgard['upfield'])
344 344
             && $this->__get($this->cm->midgard['upfield']) === $this->id
345 345
             && $this->cm->getAssociationMapping($this->cm->midgard['upfield'])['targetEntity'] === $this->cm->getName()) {
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
             $stat = $results > 0;
377 377
         }
378 378
 
379
-        if (   !$stat
379
+        if (!$stat
380 380
             && !empty($this->cm->midgard['childtypes'])) {
381 381
             foreach ($this->cm->midgard['childtypes'] as $typename => $parentfield) {
382 382
                 $qb = connection::get_em()->createQueryBuilder();
@@ -687,7 +687,7 @@  discard block
 block discarded – undo
687 687
             exception::not_exists();
688 688
             return false;
689 689
         }
690
-        if (   $check_dependencies
690
+        if ($check_dependencies
691 691
             && $this->has_dependents()) {
692 692
             exception::has_dependants();
693 693
             return false;
Please login to merge, or discard this patch.
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.