@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | : $value; |
318 | 318 | |
319 | 319 | if ($cacheKeyInfo['isIdentifier'] && $value !== null) { |
320 | - $id[$dqlAlias] .= '|' . $value; |
|
320 | + $id[$dqlAlias] .= '|'.$value; |
|
321 | 321 | $nonemptyComponents[$dqlAlias] = true; |
322 | 322 | } |
323 | 323 | break; |
@@ -352,11 +352,11 @@ discard block |
||
352 | 352 | |
353 | 353 | // WARNING: BC break! We know this is the desired behavior to type convert values, but this |
354 | 354 | // erroneous behavior exists since 2.0 and we're forced to keep compatibility. |
355 | - if (! isset($cacheKeyInfo['isScalar'])) { |
|
355 | + if ( ! isset($cacheKeyInfo['isScalar'])) { |
|
356 | 356 | $type = $cacheKeyInfo['type']; |
357 | 357 | $value = $type ? $type->convertToPHPValue($value, $this->_platform) : $value; |
358 | 358 | |
359 | - $fieldName = $cacheKeyInfo['dqlAlias'] . '_' . $fieldName; |
|
359 | + $fieldName = $cacheKeyInfo['dqlAlias'].'_'.$fieldName; |
|
360 | 360 | } |
361 | 361 | |
362 | 362 | $rowData[$fieldName] = $value; |
@@ -465,7 +465,7 @@ discard block |
||
465 | 465 | private function getDiscriminatorValues(ClassMetadata $classMetadata) : array |
466 | 466 | { |
467 | 467 | $values = array_map( |
468 | - function (string $subClass) : string { |
|
468 | + function(string $subClass) : string { |
|
469 | 469 | return (string) $this->getClassMetadata($subClass)->discriminatorValue; |
470 | 470 | }, |
471 | 471 | $classMetadata->subClasses |
@@ -69,11 +69,11 @@ |
||
69 | 69 | private function getTableFullName(array $table) : string |
70 | 70 | { |
71 | 71 | $join = '.'; |
72 | - if (! $this->platform->supportsSchemas() && $this->platform->canEmulateSchemas()) { |
|
72 | + if ( ! $this->platform->supportsSchemas() && $this->platform->canEmulateSchemas()) { |
|
73 | 73 | $join = '__'; |
74 | 74 | } |
75 | 75 | |
76 | - return $table['schema'] . $join . $table['name']; |
|
76 | + return $table['schema'].$join.$table['name']; |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | private function createClassMetadata(string $className) : ClassMetadata |
@@ -46,7 +46,7 @@ |
||
46 | 46 | |
47 | 47 | public function __construct() |
48 | 48 | { |
49 | - @trigger_error(self::class . ' is deprecated and will be removed in Doctrine ORM 3.0', E_USER_DEPRECATED); |
|
49 | + @trigger_error(self::class.' is deprecated and will be removed in Doctrine ORM 3.0', E_USER_DEPRECATED); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | /** |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | */ |
61 | 61 | public function __construct($dir = null) |
62 | 62 | { |
63 | - @trigger_error(static::class . ' is deprecated and will be removed in Doctrine ORM 3.0', E_USER_DEPRECATED); |
|
63 | + @trigger_error(static::class.' is deprecated and will be removed in Doctrine ORM 3.0', E_USER_DEPRECATED); |
|
64 | 64 | |
65 | 65 | $this->_outputDir = $dir; |
66 | 66 | } |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | if ( ! is_dir($dir)) { |
147 | 147 | mkdir($dir, 0775, true); |
148 | 148 | } |
149 | - if (file_exists($path) && !$this->_overwriteExistingFiles) { |
|
149 | + if (file_exists($path) && ! $this->_overwriteExistingFiles) { |
|
150 | 150 | throw ExportException::attemptOverwriteExistingFile($path); |
151 | 151 | } |
152 | 152 | file_put_contents($path, $output); |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | */ |
165 | 165 | protected function _generateOutputPath(ClassMetadataInfo $metadata) |
166 | 166 | { |
167 | - return $this->_outputDir . '/' . str_replace('\\', '.', $metadata->name) . $this->_extension; |
|
167 | + return $this->_outputDir.'/'.str_replace('\\', '.', $metadata->name).$this->_extension; |
|
168 | 168 | } |
169 | 169 | |
170 | 170 | /** |
@@ -227,8 +227,8 @@ discard block |
||
227 | 227 | */ |
228 | 228 | public function transactional($func) |
229 | 229 | { |
230 | - if (!is_callable($func)) { |
|
231 | - throw new \InvalidArgumentException('Expected argument of type "callable", got "' . gettype($func) . '"'); |
|
230 | + if ( ! is_callable($func)) { |
|
231 | + throw new \InvalidArgumentException('Expected argument of type "callable", got "'.gettype($func).'"'); |
|
232 | 232 | } |
233 | 233 | |
234 | 234 | $this->conn->beginTransaction(); |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | { |
359 | 359 | if ($entity !== null) { |
360 | 360 | @trigger_error( |
361 | - 'Calling ' . __METHOD__ . '() with any arguments to flush specific entities is deprecated and will not be supported in Doctrine ORM 3.0.', |
|
361 | + 'Calling '.__METHOD__.'() with any arguments to flush specific entities is deprecated and will not be supported in Doctrine ORM 3.0.', |
|
362 | 362 | E_USER_DEPRECATED |
363 | 363 | ); |
364 | 364 | } |
@@ -558,7 +558,7 @@ discard block |
||
558 | 558 | |
559 | 559 | if ($entityName !== null) { |
560 | 560 | @trigger_error( |
561 | - 'Calling ' . __METHOD__ . '() with any arguments to clear specific entities is deprecated and will not be supported in Doctrine ORM 3.0.', |
|
561 | + 'Calling '.__METHOD__.'() with any arguments to clear specific entities is deprecated and will not be supported in Doctrine ORM 3.0.', |
|
562 | 562 | E_USER_DEPRECATED |
563 | 563 | ); |
564 | 564 | } |
@@ -670,7 +670,7 @@ discard block |
||
670 | 670 | */ |
671 | 671 | public function detach($entity) |
672 | 672 | { |
673 | - @trigger_error('Method ' . __METHOD__ . '() is deprecated and will be removed in Doctrine ORM 3.0.', E_USER_DEPRECATED); |
|
673 | + @trigger_error('Method '.__METHOD__.'() is deprecated and will be removed in Doctrine ORM 3.0.', E_USER_DEPRECATED); |
|
674 | 674 | |
675 | 675 | if ( ! is_object($entity)) { |
676 | 676 | throw ORMInvalidArgumentException::invalidObject('EntityManager#detach()', $entity); |
@@ -695,7 +695,7 @@ discard block |
||
695 | 695 | */ |
696 | 696 | public function merge($entity) |
697 | 697 | { |
698 | - @trigger_error('Method ' . __METHOD__ . '() is deprecated and will be removed in Doctrine ORM 3.0.', E_USER_DEPRECATED); |
|
698 | + @trigger_error('Method '.__METHOD__.'() is deprecated and will be removed in Doctrine ORM 3.0.', E_USER_DEPRECATED); |
|
699 | 699 | |
700 | 700 | if ( ! is_object($entity)) { |
701 | 701 | throw ORMInvalidArgumentException::invalidObject('EntityManager#merge()', $entity); |
@@ -711,7 +711,7 @@ discard block |
||
711 | 711 | */ |
712 | 712 | public function copy($entity, $deep = false) |
713 | 713 | { |
714 | - @trigger_error('Method ' . __METHOD__ . '() is deprecated and will be removed in Doctrine ORM 3.0.', E_USER_DEPRECATED); |
|
714 | + @trigger_error('Method '.__METHOD__.'() is deprecated and will be removed in Doctrine ORM 3.0.', E_USER_DEPRECATED); |
|
715 | 715 | |
716 | 716 | throw new \BadMethodCallException("Not implemented."); |
717 | 717 | } |
@@ -785,7 +785,7 @@ discard block |
||
785 | 785 | */ |
786 | 786 | public function isOpen() |
787 | 787 | { |
788 | - return (!$this->closed); |
|
788 | + return ( ! $this->closed); |
|
789 | 789 | } |
790 | 790 | |
791 | 791 | /** |
@@ -896,7 +896,7 @@ discard block |
||
896 | 896 | sprintf( |
897 | 897 | 'Invalid $connection argument of type %s given%s.', |
898 | 898 | is_object($connection) ? get_class($connection) : gettype($connection), |
899 | - is_object($connection) ? '' : ': "' . $connection . '"' |
|
899 | + is_object($connection) ? '' : ': "'.$connection.'"' |
|
900 | 900 | ) |
901 | 901 | ); |
902 | 902 | } |
@@ -946,13 +946,13 @@ discard block |
||
946 | 946 | { |
947 | 947 | switch ($lockMode) { |
948 | 948 | case LockMode::OPTIMISTIC: |
949 | - if (!$class->isVersioned) { |
|
949 | + if ( ! $class->isVersioned) { |
|
950 | 950 | throw OptimisticLockException::notVersioned($class->name); |
951 | 951 | } |
952 | 952 | break; |
953 | 953 | case LockMode::PESSIMISTIC_READ: |
954 | 954 | case LockMode::PESSIMISTIC_WRITE: |
955 | - if (!$this->getConnection()->isTransactionActive()) { |
|
955 | + if ( ! $this->getConnection()->isTransactionActive()) { |
|
956 | 956 | throw TransactionRequiredException::transactionRequired(); |
957 | 957 | } |
958 | 958 | } |
@@ -60,9 +60,9 @@ discard block |
||
60 | 60 | */ |
61 | 61 | public function __construct($case = CASE_LOWER, bool $numberAware = false) |
62 | 62 | { |
63 | - if (! $numberAware) { |
|
63 | + if ( ! $numberAware) { |
|
64 | 64 | @trigger_error( |
65 | - 'Creating ' . self::class . ' without making it number aware is deprecated and will be removed in Doctrine ORM 3.0.', |
|
65 | + 'Creating '.self::class.' without making it number aware is deprecated and will be removed in Doctrine ORM 3.0.', |
|
66 | 66 | E_USER_DEPRECATED |
67 | 67 | ); |
68 | 68 | } |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | */ |
126 | 126 | public function referenceColumnName() |
127 | 127 | { |
128 | - return $this->case === CASE_UPPER ? 'ID' : 'id'; |
|
128 | + return $this->case === CASE_UPPER ? 'ID' : 'id'; |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | /** |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | */ |
134 | 134 | public function joinColumnName($propertyName, $className = null) |
135 | 135 | { |
136 | - return $this->underscore($propertyName) . '_' . $this->referenceColumnName(); |
|
136 | + return $this->underscore($propertyName).'_'.$this->referenceColumnName(); |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | /** |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | */ |
142 | 142 | public function joinTableName($sourceEntity, $targetEntity, $propertyName = null) |
143 | 143 | { |
144 | - return $this->classToTableName($sourceEntity) . '_' . $this->classToTableName($targetEntity); |
|
144 | + return $this->classToTableName($sourceEntity).'_'.$this->classToTableName($targetEntity); |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | /** |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | */ |
150 | 150 | public function joinKeyColumnName($entityName, $referencedColumnName = null) |
151 | 151 | { |
152 | - return $this->classToTableName($entityName) . '_' . |
|
152 | + return $this->classToTableName($entityName).'_'. |
|
153 | 153 | ($referencedColumnName ?: $this->referenceColumnName()); |
154 | 154 | } |
155 | 155 |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | $relation = $class->associationMappings[$fieldName]; |
187 | 187 | $reflField = $class->reflFields[$fieldName]; |
188 | 188 | $value = null; |
189 | - if (!method_exists($reflField, 'isInitialized') || $reflField->isInitialized($entity)) { |
|
189 | + if ( ! method_exists($reflField, 'isInitialized') || $reflField->isInitialized($entity)) { |
|
190 | 190 | $value = $reflField->getValue($entity); |
191 | 191 | } |
192 | 192 | |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | $class->reflFields[$fieldName]->setValue($entity, $value); |
204 | 204 | $this->_uow->setOriginalEntityProperty($oid, $fieldName, $value); |
205 | 205 | |
206 | - $this->initializedCollections[$oid . $fieldName] = $value; |
|
206 | + $this->initializedCollections[$oid.$fieldName] = $value; |
|
207 | 207 | } else if ( |
208 | 208 | isset($this->_hints[Query::HINT_REFRESH]) || |
209 | 209 | isset($this->_hints['fetched'][$parentDqlAlias][$fieldName]) && |
@@ -214,10 +214,10 @@ discard block |
||
214 | 214 | $value->setInitialized(true); |
215 | 215 | $value->unwrap()->clear(); |
216 | 216 | |
217 | - $this->initializedCollections[$oid . $fieldName] = $value; |
|
217 | + $this->initializedCollections[$oid.$fieldName] = $value; |
|
218 | 218 | } else { |
219 | 219 | // Is already PersistentCollection, and DON'T REFRESH or FETCH-JOIN! |
220 | - $this->existingCollections[$oid . $fieldName] = $value; |
|
220 | + $this->existingCollections[$oid.$fieldName] = $value; |
|
221 | 221 | } |
222 | 222 | |
223 | 223 | return $value; |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | $idHash = ''; |
292 | 292 | |
293 | 293 | foreach ($class->identifier as $fieldName) { |
294 | - $idHash .= ' ' . (isset($class->associationMappings[$fieldName]) |
|
294 | + $idHash .= ' '.(isset($class->associationMappings[$fieldName]) |
|
295 | 295 | ? $data[$class->associationMappings[$fieldName]['joinColumns'][0]['name']] |
296 | 296 | : $data[$fieldName]); |
297 | 297 | } |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | $parentAlias = $this->_rsm->parentAliasMap[$dqlAlias]; |
348 | 348 | // we need the $path to save into the identifier map which entities were already |
349 | 349 | // seen for this parent-child relationship |
350 | - $path = $parentAlias . '.' . $dqlAlias; |
|
350 | + $path = $parentAlias.'.'.$dqlAlias; |
|
351 | 351 | |
352 | 352 | // We have a RIGHT JOIN result here. Doctrine cannot hydrate RIGHT JOIN Object-Graphs |
353 | 353 | if ( ! isset($nonemptyComponents[$parentAlias])) { |
@@ -381,7 +381,7 @@ discard block |
||
381 | 381 | |
382 | 382 | $oid = spl_object_hash($parentObject); |
383 | 383 | $reflFieldValue = null; |
384 | - if (!method_exists($reflField, 'isInitialized') || $reflField->isInitialized($parentObject)) { |
|
384 | + if ( ! method_exists($reflField, 'isInitialized') || $reflField->isInitialized($parentObject)) { |
|
385 | 385 | $reflFieldValue = $reflField->getValue($parentObject); |
386 | 386 | } |
387 | 387 | |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | if ( ! ($relation['type'] & ClassMetadata::TO_ONE)) { |
390 | 390 | // PATH A: Collection-valued association |
391 | 391 | if (isset($nonemptyComponents[$dqlAlias])) { |
392 | - $collKey = $oid . $relationField; |
|
392 | + $collKey = $oid.$relationField; |
|
393 | 393 | if (isset($this->initializedCollections[$collKey])) { |
394 | 394 | $reflFieldValue = $this->initializedCollections[$collKey]; |
395 | 395 | } else if ( ! isset($this->existingCollections[$collKey])) { |
@@ -435,7 +435,7 @@ discard block |
||
435 | 435 | |
436 | 436 | } else { |
437 | 437 | // PATH B: Single-valued association |
438 | - if ( ! $reflFieldValue || isset($this->_hints[Query::HINT_REFRESH]) || ($reflFieldValue instanceof Proxy && !$reflFieldValue->__isInitialized__)) { |
|
438 | + if ( ! $reflFieldValue || isset($this->_hints[Query::HINT_REFRESH]) || ($reflFieldValue instanceof Proxy && ! $reflFieldValue->__isInitialized__)) { |
|
439 | 439 | // we only need to take action if this value is null, |
440 | 440 | // we refresh the entity or its an uninitialized proxy. |
441 | 441 | if (isset($nonemptyComponents[$dqlAlias])) { |
@@ -480,7 +480,7 @@ discard block |
||
480 | 480 | $entityKey = $this->_rsm->entityMappings[$dqlAlias] ?: 0; |
481 | 481 | |
482 | 482 | // if this row has a NULL value for the root result id then make it a null result. |
483 | - if ( ! isset($nonemptyComponents[$dqlAlias]) ) { |
|
483 | + if ( ! isset($nonemptyComponents[$dqlAlias])) { |
|
484 | 484 | if ($this->_rsm->isMixed) { |
485 | 485 | $result[] = [$entityKey => null]; |
486 | 486 | } else { |
@@ -536,13 +536,13 @@ discard block |
||
536 | 536 | } |
537 | 537 | } |
538 | 538 | |
539 | - if ( ! isset($resultKey) ) { |
|
539 | + if ( ! isset($resultKey)) { |
|
540 | 540 | $this->resultCounter++; |
541 | 541 | } |
542 | 542 | |
543 | 543 | // Append scalar values to mixed result sets |
544 | 544 | if (isset($rowData['scalars'])) { |
545 | - if ( ! isset($resultKey) ) { |
|
545 | + if ( ! isset($resultKey)) { |
|
546 | 546 | $resultKey = (isset($this->_rsm->indexByMap['scalars'])) |
547 | 547 | ? $row[$this->_rsm->indexByMap['scalars']] |
548 | 548 | : $this->resultCounter - 1; |
@@ -555,19 +555,19 @@ discard block |
||
555 | 555 | |
556 | 556 | // Append new object to mixed result sets |
557 | 557 | if (isset($rowData['newObjects'])) { |
558 | - if ( ! isset($resultKey) ) { |
|
558 | + if ( ! isset($resultKey)) { |
|
559 | 559 | $resultKey = $this->resultCounter - 1; |
560 | 560 | } |
561 | 561 | |
562 | 562 | |
563 | - $scalarCount = (isset($rowData['scalars'])? count($rowData['scalars']): 0); |
|
563 | + $scalarCount = (isset($rowData['scalars']) ? count($rowData['scalars']) : 0); |
|
564 | 564 | |
565 | 565 | foreach ($rowData['newObjects'] as $objIndex => $newObject) { |
566 | 566 | $class = $newObject['class']; |
567 | 567 | $args = $newObject['args']; |
568 | 568 | $obj = $class->newInstanceArgs($args); |
569 | 569 | |
570 | - if ($scalarCount == 0 && count($rowData['newObjects']) == 1 ) { |
|
570 | + if ($scalarCount == 0 && count($rowData['newObjects']) == 1) { |
|
571 | 571 | $result[$resultKey] = $obj; |
572 | 572 | |
573 | 573 | continue; |