@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | $this->hints = $em->getConfiguration()->getDefaultQueryHints(); |
| 149 | 149 | $this->hasCache = $this->em->getConfiguration()->isSecondLevelCacheEnabled(); |
| 150 | 150 | |
| 151 | - if (! $this->hasCache) { |
|
| 151 | + if ( ! $this->hasCache) { |
|
| 152 | 152 | return; |
| 153 | 153 | } |
| 154 | 154 | |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | public function getParameter($key) |
| 303 | 303 | { |
| 304 | 304 | $filteredParameters = $this->parameters->filter( |
| 305 | - function (Query\Parameter $parameter) use ($key) : bool { |
|
| 305 | + function(Query\Parameter $parameter) use ($key) : bool { |
|
| 306 | 306 | $parameterName = $parameter->getName(); |
| 307 | 307 | |
| 308 | 308 | return $key === $parameterName || (string) $key === (string) $parameterName; |
@@ -718,7 +718,7 @@ discard block |
||
| 718 | 718 | return null; |
| 719 | 719 | } |
| 720 | 720 | |
| 721 | - if (! is_array($result)) { |
|
| 721 | + if ( ! is_array($result)) { |
|
| 722 | 722 | return $result; |
| 723 | 723 | } |
| 724 | 724 | |
@@ -752,7 +752,7 @@ discard block |
||
| 752 | 752 | throw new NoResultException(); |
| 753 | 753 | } |
| 754 | 754 | |
| 755 | - if (! is_array($result)) { |
|
| 755 | + if ( ! is_array($result)) { |
|
| 756 | 756 | return $result; |
| 757 | 757 | } |
| 758 | 758 | |
@@ -842,7 +842,7 @@ discard block |
||
| 842 | 842 | $this->setHydrationMode($hydrationMode); |
| 843 | 843 | } |
| 844 | 844 | |
| 845 | - if (! empty($parameters)) { |
|
| 845 | + if ( ! empty($parameters)) { |
|
| 846 | 846 | $this->setParameters($parameters); |
| 847 | 847 | } |
| 848 | 848 | |
@@ -881,11 +881,11 @@ discard block |
||
| 881 | 881 | $this->setHydrationMode($hydrationMode); |
| 882 | 882 | } |
| 883 | 883 | |
| 884 | - if (! empty($parameters)) { |
|
| 884 | + if ( ! empty($parameters)) { |
|
| 885 | 885 | $this->setParameters($parameters); |
| 886 | 886 | } |
| 887 | 887 | |
| 888 | - $setCacheEntry = function () { |
|
| 888 | + $setCacheEntry = function() { |
|
| 889 | 889 | }; |
| 890 | 890 | |
| 891 | 891 | if ($this->hydrationCacheProfile !== null) { |
@@ -899,11 +899,11 @@ discard block |
||
| 899 | 899 | return $result[$realCacheKey]; |
| 900 | 900 | } |
| 901 | 901 | |
| 902 | - if (! $result) { |
|
| 902 | + if ( ! $result) { |
|
| 903 | 903 | $result = []; |
| 904 | 904 | } |
| 905 | 905 | |
| 906 | - $setCacheEntry = function ($data) use ($cache, $result, $cacheKey, $realCacheKey, $queryCacheProfile) { |
|
| 906 | + $setCacheEntry = function($data) use ($cache, $result, $cacheKey, $realCacheKey, $queryCacheProfile) { |
|
| 907 | 907 | $result[$realCacheKey] = $data; |
| 908 | 908 | |
| 909 | 909 | $cache->save($cacheKey, $result, $queryCacheProfile->getLifetime()); |
@@ -1065,7 +1065,7 @@ discard block |
||
| 1065 | 1065 | { |
| 1066 | 1066 | $query = $this->getSQL(); |
| 1067 | 1067 | $hints = $this->getHints(); |
| 1068 | - $params = array_map(function (Parameter $parameter) { |
|
| 1068 | + $params = array_map(function(Parameter $parameter) { |
|
| 1069 | 1069 | $value = $parameter->getValue(); |
| 1070 | 1070 | |
| 1071 | 1071 | // Small optimization |
@@ -1079,6 +1079,6 @@ discard block |
||
| 1079 | 1079 | |
| 1080 | 1080 | ksort($hints); |
| 1081 | 1081 | |
| 1082 | - return sha1($query . '-' . serialize($params) . '-' . serialize($hints)); |
|
| 1082 | + return sha1($query.'-'.serialize($params).'-'.serialize($hints)); |
|
| 1083 | 1083 | } |
| 1084 | 1084 | } |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | |
| 151 | 151 | // If _backRefFieldName is set and its a one-to-many association, |
| 152 | 152 | // we need to set the back reference. |
| 153 | - if (! $this->backRefFieldName || ! ($this->association instanceof OneToManyAssociationMetadata)) { |
|
| 153 | + if ( ! $this->backRefFieldName || ! ($this->association instanceof OneToManyAssociationMetadata)) { |
|
| 154 | 154 | return; |
| 155 | 155 | } |
| 156 | 156 | |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | |
| 180 | 180 | // If _backRefFieldName is set, then the association is bidirectional |
| 181 | 181 | // and we need to set the back reference. |
| 182 | - if (! $this->backRefFieldName || ! ($this->association instanceof OneToManyAssociationMetadata)) { |
|
| 182 | + if ( ! $this->backRefFieldName || ! ($this->association instanceof OneToManyAssociationMetadata)) { |
|
| 183 | 183 | return; |
| 184 | 184 | } |
| 185 | 185 | |
@@ -284,7 +284,7 @@ discard block |
||
| 284 | 284 | |
| 285 | 285 | $this->isDirty = true; |
| 286 | 286 | |
| 287 | - if (! ($this->association instanceof ManyToManyAssociationMetadata) || |
|
| 287 | + if ( ! ($this->association instanceof ManyToManyAssociationMetadata) || |
|
| 288 | 288 | ! $this->owner || |
| 289 | 289 | ! $this->association->isOwningSide() || |
| 290 | 290 | $this->em->getClassMetadata(get_class($this->owner))->changeTrackingPolicy !== ChangeTrackingPolicy::NOTIFY) { |
@@ -336,7 +336,7 @@ discard block |
||
| 336 | 336 | // association (table). Without initializing the collection. |
| 337 | 337 | $removed = parent::remove($key); |
| 338 | 338 | |
| 339 | - if (! $removed) { |
|
| 339 | + if ( ! $removed) { |
|
| 340 | 340 | return $removed; |
| 341 | 341 | } |
| 342 | 342 | |
@@ -357,7 +357,7 @@ discard block |
||
| 357 | 357 | */ |
| 358 | 358 | public function removeElement($element) |
| 359 | 359 | { |
| 360 | - if (! $this->initialized && |
|
| 360 | + if ( ! $this->initialized && |
|
| 361 | 361 | $this->association !== null && |
| 362 | 362 | $this->association->getFetchMode() === FetchMode::EXTRA_LAZY) { |
| 363 | 363 | if ($this->collection->contains($element)) { |
@@ -371,7 +371,7 @@ discard block |
||
| 371 | 371 | |
| 372 | 372 | $removed = parent::removeElement($element); |
| 373 | 373 | |
| 374 | - if (! $removed) { |
|
| 374 | + if ( ! $removed) { |
|
| 375 | 375 | return $removed; |
| 376 | 376 | } |
| 377 | 377 | |
@@ -392,7 +392,7 @@ discard block |
||
| 392 | 392 | */ |
| 393 | 393 | public function containsKey($key) |
| 394 | 394 | { |
| 395 | - if (! $this->initialized && |
|
| 395 | + if ( ! $this->initialized && |
|
| 396 | 396 | $this->association !== null && |
| 397 | 397 | $this->association->getFetchMode() === FetchMode::EXTRA_LAZY && |
| 398 | 398 | $this->association->getIndexedBy()) { |
@@ -409,7 +409,7 @@ discard block |
||
| 409 | 409 | */ |
| 410 | 410 | public function contains($element) |
| 411 | 411 | { |
| 412 | - if (! $this->initialized && |
|
| 412 | + if ( ! $this->initialized && |
|
| 413 | 413 | $this->association !== null && |
| 414 | 414 | $this->association->getFetchMode() === FetchMode::EXTRA_LAZY) { |
| 415 | 415 | $persister = $this->em->getUnitOfWork()->getCollectionPersister($this->association); |
@@ -425,11 +425,11 @@ discard block |
||
| 425 | 425 | */ |
| 426 | 426 | public function get($key) |
| 427 | 427 | { |
| 428 | - if (! $this->initialized && |
|
| 428 | + if ( ! $this->initialized && |
|
| 429 | 429 | $this->association !== null && |
| 430 | 430 | $this->association->getFetchMode() === FetchMode::EXTRA_LAZY && |
| 431 | 431 | $this->association->getIndexedBy()) { |
| 432 | - if (! $this->typeClass->isIdentifierComposite() && $this->typeClass->isIdentifier($this->association->getIndexedBy())) { |
|
| 432 | + if ( ! $this->typeClass->isIdentifierComposite() && $this->typeClass->isIdentifier($this->association->getIndexedBy())) { |
|
| 433 | 433 | return $this->em->find($this->typeClass->getClassName(), $key); |
| 434 | 434 | } |
| 435 | 435 | |
@@ -444,7 +444,7 @@ discard block |
||
| 444 | 444 | */ |
| 445 | 445 | public function count() |
| 446 | 446 | { |
| 447 | - if (! $this->initialized && |
|
| 447 | + if ( ! $this->initialized && |
|
| 448 | 448 | $this->association !== null && |
| 449 | 449 | $this->association->getFetchMode() === FetchMode::EXTRA_LAZY) { |
| 450 | 450 | $persister = $this->em->getUnitOfWork()->getCollectionPersister($this->association); |
@@ -464,7 +464,7 @@ discard block |
||
| 464 | 464 | |
| 465 | 465 | $this->changed(); |
| 466 | 466 | |
| 467 | - if (! is_object($value) || ! $this->em) { |
|
| 467 | + if ( ! is_object($value) || ! $this->em) { |
|
| 468 | 468 | return; |
| 469 | 469 | } |
| 470 | 470 | |
@@ -510,7 +510,7 @@ discard block |
||
| 510 | 510 | */ |
| 511 | 511 | public function offsetSet($offset, $value) |
| 512 | 512 | { |
| 513 | - if (! isset($offset)) { |
|
| 513 | + if ( ! isset($offset)) { |
|
| 514 | 514 | $this->add($value); |
| 515 | 515 | return; |
| 516 | 516 | } |
@@ -567,7 +567,7 @@ discard block |
||
| 567 | 567 | |
| 568 | 568 | $this->initialized = true; // direct call, {@link initialize()} is too expensive |
| 569 | 569 | |
| 570 | - if (! $this->association->isOwningSide() || ! $this->owner) { |
|
| 570 | + if ( ! $this->association->isOwningSide() || ! $this->owner) { |
|
| 571 | 571 | return; |
| 572 | 572 | } |
| 573 | 573 | |
@@ -606,7 +606,7 @@ discard block |
||
| 606 | 606 | */ |
| 607 | 607 | public function slice($offset, $length = null) |
| 608 | 608 | { |
| 609 | - if (! $this->initialized && |
|
| 609 | + if ( ! $this->initialized && |
|
| 610 | 610 | ! $this->isDirty && |
| 611 | 611 | $this->association !== null && |
| 612 | 612 | $this->association->getFetchMode() === FetchMode::EXTRA_LAZY) { |
@@ -708,7 +708,7 @@ discard block |
||
| 708 | 708 | $this->em->getUnitOfWork()->loadCollection($this); |
| 709 | 709 | $this->takeSnapshot(); |
| 710 | 710 | |
| 711 | - if (! $newlyAddedDirtyObjects) { |
|
| 711 | + if ( ! $newlyAddedDirtyObjects) { |
|
| 712 | 712 | return; |
| 713 | 713 | } |
| 714 | 714 | |
@@ -730,7 +730,7 @@ discard block |
||
| 730 | 730 | $loadedObjectsByOid = array_combine(array_map('spl_object_id', $loadedObjects), $loadedObjects); |
| 731 | 731 | $newObjectsThatWereNotLoaded = array_diff_key($newObjectsByOid, $loadedObjectsByOid); |
| 732 | 732 | |
| 733 | - if (! $newObjectsThatWereNotLoaded) { |
|
| 733 | + if ( ! $newObjectsThatWereNotLoaded) { |
|
| 734 | 734 | return; |
| 735 | 735 | } |
| 736 | 736 | |