@@ -1,6 +1,6 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\ORM; |
6 | 6 | |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | $expectedLockVersion = ($expectedLockVersion instanceof \DateTime) ? $expectedLockVersion->getTimestamp() : $expectedLockVersion; |
62 | 62 | $actualLockVersion = ($actualLockVersion instanceof \DateTime) ? $actualLockVersion->getTimestamp() : $actualLockVersion; |
63 | 63 | |
64 | - return new self("The optimistic lock failed, version " . $expectedLockVersion . " was expected, but is actually ".$actualLockVersion, $entity); |
|
64 | + return new self("The optimistic lock failed, version ".$expectedLockVersion." was expected, but is actually ".$actualLockVersion, $entity); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | /** |
@@ -71,6 +71,6 @@ discard block |
||
71 | 71 | */ |
72 | 72 | public static function notVersioned($entityName) |
73 | 73 | { |
74 | - return new self("Cannot obtain optimistic lock on unversioned entity " . $entityName, null); |
|
74 | + return new self("Cannot obtain optimistic lock on unversioned entity ".$entityName, null); |
|
75 | 75 | } |
76 | 76 | } |
@@ -1,6 +1,6 @@ discard block |
||
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 |
||
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)); |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | |
4 | -declare(strict_types=1); |
|
4 | +declare(strict_types = 1); |
|
5 | 5 | |
6 | 6 | namespace Doctrine\ORM\Sequencing; |
7 | 7 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\ORM\Sequencing; |
6 | 6 | |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | $this->tableName, $this->sequenceName, $this->allocationSize |
78 | 78 | ); |
79 | 79 | |
80 | - if ($conn->executeUpdate($updateSql, [1 => $currentLevel, 2 => $currentLevel+1]) !== 1) { |
|
80 | + if ($conn->executeUpdate($updateSql, [1 => $currentLevel, 2 => $currentLevel + 1]) !== 1) { |
|
81 | 81 | // no affected rows, concurrency issue, throw exception |
82 | 82 | } |
83 | 83 | } else { |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | |
4 | -declare(strict_types=1); |
|
4 | +declare(strict_types = 1); |
|
5 | 5 | |
6 | 6 | namespace Doctrine\ORM\Sequencing\Planning; |
7 | 7 | |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | public function executeDeferred(EntityManagerInterface $entityManager, /*object*/ $entity): void |
41 | 41 | { |
42 | 42 | foreach ($this->executors as $executor) { |
43 | - if (! $executor->isDeferred()) { |
|
43 | + if ( ! $executor->isDeferred()) { |
|
44 | 44 | continue; |
45 | 45 | } |
46 | 46 |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | |
4 | -declare(strict_types=1); |
|
4 | +declare(strict_types = 1); |
|
5 | 5 | |
6 | 6 | namespace Doctrine\ORM\Sequencing\Planning; |
7 | 7 |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | |
4 | -declare(strict_types=1); |
|
4 | +declare(strict_types = 1); |
|
5 | 5 | |
6 | 6 | namespace Doctrine\ORM\Sequencing\Planning; |
7 | 7 | |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | |
26 | 26 | public function executeImmediate(EntityManagerInterface $entityManager, /*object*/ $entity): void |
27 | 27 | { |
28 | - if (! $this->executor->isDeferred()) { |
|
28 | + if ( ! $this->executor->isDeferred()) { |
|
29 | 29 | $this->dispatchExecutor($entity, $entityManager); |
30 | 30 | } |
31 | 31 | } |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\ORM; |
6 | 6 | |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | return $this->collection->isEmpty(); |
79 | 79 | } |
80 | 80 | |
81 | - return !$this->count(); |
|
81 | + return ! $this->count(); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | /** |