Failed Conditions
Push — master ( 9452f0...8be1e3 )
by Marco
10:03
created
lib/Doctrine/ORM/PersistentObject.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\ORM;
6 6
 
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
     {
90 90
         if ($entityManager !== self::$entityManager) {
91 91
             throw new \RuntimeException(
92
-                "Trying to use PersistentObject with different EntityManager instances. " .
92
+                "Trying to use PersistentObject with different EntityManager instances. ".
93 93
                 "Was PersistentObject::setEntityManager() called?"
94 94
             );
95 95
         }
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 
115 115
         $property = $this->cm->getProperty($field);
116 116
 
117
-        if (! $property) {
117
+        if ( ! $property) {
118 118
             throw new \BadMethodCallException("no field with name '".$field."' exists on '".$this->cm->getClassName()."'");
119 119
         }
120 120
 
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 
154 154
         $property = $this->cm->getProperty($field);
155 155
 
156
-        if (! $property) {
156
+        if ( ! $property) {
157 157
             throw new \BadMethodCallException("no field with name '".$field."' exists on '".$this->cm->getClassName()."'");
158 158
         }
159 159
 
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
         $mappedByField    = $property->getMappedBy();
180 180
         $targetMetadata   = self::$entityManager->getClassMetadata($property->getTargetEntity());
181 181
         $targetProperty   = $targetMetadata->getProperty($mappedByField);
182
-        $setterMethodName = ($targetProperty instanceof ToManyAssociationMetadata ? 'add' : 'set') . $mappedByField;
182
+        $setterMethodName = ($targetProperty instanceof ToManyAssociationMetadata ? 'add' : 'set').$mappedByField;
183 183
 
184 184
         $targetObject->{$setterMethodName}($this);
185 185
     }
@@ -201,21 +201,21 @@  discard block
 block discarded – undo
201 201
 
202 202
         $property = $this->cm->getProperty($field);
203 203
 
204
-        if (! $property) {
204
+        if ( ! $property) {
205 205
             throw new \BadMethodCallException("no field with name '".$field."' exists on '".$this->cm->getClassName()."'");
206 206
         }
207 207
 
208
-        if (! ($property instanceof ToManyAssociationMetadata)) {
208
+        if ( ! ($property instanceof ToManyAssociationMetadata)) {
209 209
             throw new \BadMethodCallException("There is no method add".$field."() on ".$this->cm->getClassName());
210 210
         }
211 211
 
212 212
         $targetClassName = $property->getTargetEntity();
213 213
 
214
-        if (! ($args[0] instanceof $targetClassName)) {
214
+        if ( ! ($args[0] instanceof $targetClassName)) {
215 215
             throw new \InvalidArgumentException("Expected persistent object of type '".$targetClassName."'");
216 216
         }
217 217
 
218
-        if (! ($this->{$field} instanceof Collection)) {
218
+        if ( ! ($this->{$field} instanceof Collection)) {
219 219
             $this->{$field} = new ArrayCollection($this->{$field} ?: []);
220 220
         }
221 221
 
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
             return;
240 240
         }
241 241
 
242
-        if (!self::$entityManager) {
242
+        if ( ! self::$entityManager) {
243 243
             throw new \RuntimeException("No runtime entity manager set. Call PersistentObject#setEntityManager().");
244 244
         }
245 245
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/EntityRepository.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\ORM;
6 6
 
@@ -292,14 +292,14 @@  discard block
 block discarded – undo
292 292
      */
293 293
     private function resolveMagicCall($method, $by, array $arguments)
294 294
     {
295
-        if (! $arguments) {
296
-            throw ORMException::findByRequiresParameter($method . $by);
295
+        if ( ! $arguments) {
296
+            throw ORMException::findByRequiresParameter($method.$by);
297 297
         }
298 298
 
299 299
         $fieldName = lcfirst(Inflector::classify($by));
300 300
 
301 301
         if (null === $this->class->getProperty($fieldName)) {
302
-            throw ORMException::invalidMagicCall($this->entityName, $fieldName, $method . $by);
302
+            throw ORMException::invalidMagicCall($this->entityName, $fieldName, $method.$by);
303 303
         }
304 304
 
305 305
         return $this->{$method}([$fieldName => $arguments[0]], ...array_slice($arguments, 1));
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Functional/PaginationTest.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\Tests\ORM\Functional;
6 6
 
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
         $iter = $paginator->getIterator();
132 132
         self::assertCount(9, $iter);
133 133
         $result = iterator_to_array($iter);
134
-        self::assertEquals($checkField . "0", $result[0]->{$checkField});
134
+        self::assertEquals($checkField."0", $result[0]->{$checkField});
135 135
     }
136 136
 
137 137
     private function iterateWithOrderAscWithLimit($useOutputWalkers, $fetchJoinCollection, $baseDql, $checkField)
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
         $iter = $paginator->getIterator();
148 148
         self::assertCount(3, $iter);
149 149
         $result = iterator_to_array($iter);
150
-        self::assertEquals($checkField . "0", $result[0]->{$checkField});
150
+        self::assertEquals($checkField."0", $result[0]->{$checkField});
151 151
     }
152 152
 
153 153
     private function iterateWithOrderAscWithLimitAndOffset($useOutputWalkers, $fetchJoinCollection, $baseDql, $checkField)
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
         $iter = $paginator->getIterator();
164 164
         self::assertCount(3, $iter);
165 165
         $result = iterator_to_array($iter);
166
-        self::assertEquals($checkField . "3", $result[0]->{$checkField});
166
+        self::assertEquals($checkField."3", $result[0]->{$checkField});
167 167
     }
168 168
 
169 169
     private function iterateWithOrderDesc($useOutputWalkers, $fetchJoinCollection, $baseDql, $checkField)
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
         $iter = $paginator->getIterator();
177 177
         self::assertCount(9, $iter);
178 178
         $result = iterator_to_array($iter);
179
-        self::assertEquals($checkField . "8", $result[0]->{$checkField});
179
+        self::assertEquals($checkField."8", $result[0]->{$checkField});
180 180
     }
181 181
 
182 182
     private function iterateWithOrderDescWithLimit($useOutputWalkers, $fetchJoinCollection, $baseDql, $checkField)
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
         $iter = $paginator->getIterator();
192 192
         self::assertCount(3, $iter);
193 193
         $result = iterator_to_array($iter);
194
-        self::assertEquals($checkField . "8", $result[0]->{$checkField});
194
+        self::assertEquals($checkField."8", $result[0]->{$checkField});
195 195
     }
196 196
 
197 197
     private function iterateWithOrderDescWithLimitAndOffset($useOutputWalkers, $fetchJoinCollection, $baseDql, $checkField)
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
         $iter = $paginator->getIterator();
207 207
         self::assertCount(3, $iter);
208 208
         $result = iterator_to_array($iter);
209
-        self::assertEquals($checkField . "5", $result[0]->{$checkField});
209
+        self::assertEquals($checkField."5", $result[0]->{$checkField});
210 210
     }
211 211
 
212 212
     /**
@@ -479,8 +479,8 @@  discard block
 block discarded – undo
479 479
     public function testIterateWithFetchJoinOneToManyWithOrderByColumnFromBoth($useOutputWalkers)
480 480
     {
481 481
         $dql = 'SELECT c, d FROM Doctrine\Tests\Models\Pagination\Company c JOIN c.departments d ORDER BY c.name';
482
-        $dqlAsc = $dql . " ASC, d.name";
483
-        $dqlDesc = $dql . " DESC, d.name";
482
+        $dqlAsc = $dql." ASC, d.name";
483
+        $dqlDesc = $dql." DESC, d.name";
484 484
         $this->iterateWithOrderAsc($useOutputWalkers, true, $dqlAsc, "name");
485 485
         $this->iterateWithOrderDesc($useOutputWalkers, true, $dqlDesc, "name");
486 486
     }
@@ -488,8 +488,8 @@  discard block
 block discarded – undo
488 488
     public function testIterateWithFetchJoinOneToManyWithOrderByColumnFromBothWithLimitWithOutputWalker()
489 489
     {
490 490
         $dql = 'SELECT c, d FROM Doctrine\Tests\Models\Pagination\Company c JOIN c.departments d ORDER BY c.name';
491
-        $dqlAsc = $dql . " ASC, d.name";
492
-        $dqlDesc = $dql . " DESC, d.name";
491
+        $dqlAsc = $dql." ASC, d.name";
492
+        $dqlDesc = $dql." DESC, d.name";
493 493
         $this->iterateWithOrderAscWithLimit(true, true, $dqlAsc, "name");
494 494
         $this->iterateWithOrderDescWithLimit(true, true, $dqlDesc, "name");
495 495
     }
@@ -500,8 +500,8 @@  discard block
 block discarded – undo
500 500
         $this->expectExceptionMessage('Cannot select distinct identifiers from query with LIMIT and ORDER BY on a column from a fetch joined to-many association. Use output walkers.');
501 501
 
502 502
         $dql = 'SELECT c, d FROM Doctrine\Tests\Models\Pagination\Company c JOIN c.departments d ORDER BY c.name';
503
-        $dqlAsc = $dql . " ASC, d.name";
504
-        $dqlDesc = $dql . " DESC, d.name";
503
+        $dqlAsc = $dql." ASC, d.name";
504
+        $dqlDesc = $dql." DESC, d.name";
505 505
         $this->iterateWithOrderAscWithLimit(false, true, $dqlAsc, "name");
506 506
         $this->iterateWithOrderDescWithLimit(false, true, $dqlDesc, "name");
507 507
     }
@@ -585,7 +585,7 @@  discard block
 block discarded – undo
585 585
         $users = iterator_to_array($paginator->getIterator());
586 586
         self::assertCount(9, $users);
587 587
         foreach ($users as $i => $user) {
588
-            self::assertEquals("username" . (8 - $i), $user->username);
588
+            self::assertEquals("username".(8 - $i), $user->username);
589 589
         }
590 590
     }
591 591
 
@@ -735,7 +735,7 @@  discard block
 block discarded – undo
735 735
             $company->logo->image_width = 100 + $i;
736 736
             $company->logo->image_height = 100 + $i;
737 737
             $company->logo->company = $company;
738
-            for ($j=0;$j<3;$j++) {
738
+            for ($j = 0; $j < 3; $j++) {
739 739
                 $department = new Department();
740 740
                 $department->name = "name$i$j";
741 741
                 $department->company = $company;
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/EntityManagerTest.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\Tests\ORM;
6 6
 
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
     public function testThrowsExceptionOnNonObjectValues($methodName)
168 168
     {
169 169
         $this->expectException(ORMInvalidArgumentException::class);
170
-        $this->expectExceptionMessage('EntityManager#' . $methodName . '() expects parameter 1 to be an entity object, NULL given.');
170
+        $this->expectExceptionMessage('EntityManager#'.$methodName.'() expects parameter 1 to be an entity object, NULL given.');
171 171
 
172 172
         $this->em->{$methodName}(null);
173 173
     }
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
     {
212 212
         self::assertSame(
213 213
             $value,
214
-            $this->em->transactional(function ($em) use ($value) {
214
+            $this->em->transactional(function($em) use ($value) {
215 215
                 return $value;
216 216
             })
217 217
         );
@@ -244,8 +244,8 @@  discard block
 block discarded – undo
244 244
     public function testTransactionalReThrowsThrowables()
245 245
     {
246 246
         try {
247
-            $this->em->transactional(function () {
248
-                (function (array $value) {
247
+            $this->em->transactional(function() {
248
+                (function(array $value) {
249 249
                     // this only serves as an IIFE that throws a `TypeError`
250 250
                 })(null);
251 251
             });
Please login to merge, or discard this patch.