Failed Conditions
Pull Request — master (#6735)
by Matthias
10:46
created
lib/Doctrine/ORM/EntityManager.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
     {
291 291
         $query = new Query($this);
292 292
 
293
-        if (! empty($dql)) {
293
+        if ( ! empty($dql)) {
294 294
             $query->setDQL($dql);
295 295
         }
296 296
 
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
             $this->checkLockRequirements($lockMode, $class);
382 382
         }
383 383
 
384
-        if (! is_array($id)) {
384
+        if ( ! is_array($id)) {
385 385
             if ($class->isIdentifierComposite()) {
386 386
                 throw ORMInvalidArgumentException::invalidCompositeIdentifier();
387 387
             }
@@ -402,7 +402,7 @@  discard block
 block discarded – undo
402 402
         $sortedId = [];
403 403
 
404 404
         foreach ($class->identifier as $identifier) {
405
-            if (! isset($id[$identifier])) {
405
+            if ( ! isset($id[$identifier])) {
406 406
                 throw MissingIdentifierField::fromFieldAndClass($identifier, $className);
407 407
             }
408 408
 
@@ -419,7 +419,7 @@  discard block
 block discarded – undo
419 419
         // Check identity map first
420 420
         $entity = $unitOfWork->tryGetById($sortedId, $class->getRootClassName());
421 421
         if ($entity !== false) {
422
-            if (! ($entity instanceof $className)) {
422
+            if ( ! ($entity instanceof $className)) {
423 423
                 return null;
424 424
             }
425 425
 
@@ -464,7 +464,7 @@  discard block
 block discarded – undo
464 464
         $class     = $this->metadataFactory->getMetadataFor(ltrim($entityName, '\\'));
465 465
         $className = $class->getClassName();
466 466
 
467
-        if (! is_array($id)) {
467
+        if ( ! is_array($id)) {
468 468
             if ($class->isIdentifierComposite()) {
469 469
                 throw ORMInvalidArgumentException::invalidCompositeIdentifier();
470 470
             }
@@ -489,7 +489,7 @@  discard block
 block discarded – undo
489 489
         $sortedId = [];
490 490
 
491 491
         foreach ($class->identifier as $identifier) {
492
-            if (! isset($scalarId[$identifier])) {
492
+            if ( ! isset($scalarId[$identifier])) {
493 493
                 throw MissingIdentifierField::fromFieldAndClass($identifier, $className);
494 494
             }
495 495
 
@@ -530,7 +530,7 @@  discard block
 block discarded – undo
530 530
         $class     = $this->metadataFactory->getMetadataFor(ltrim($entityName, '\\'));
531 531
         $className = $class->getClassName();
532 532
 
533
-        if (! is_array($id)) {
533
+        if ( ! is_array($id)) {
534 534
             if ($class->isIdentifierComposite()) {
535 535
                 throw ORMInvalidArgumentException::invalidCompositeIdentifier();
536 536
             }
@@ -551,7 +551,7 @@  discard block
 block discarded – undo
551 551
         $sortedId = [];
552 552
 
553 553
         foreach ($class->identifier as $identifier) {
554
-            if (! isset($id[$identifier])) {
554
+            if ( ! isset($id[$identifier])) {
555 555
                 throw MissingIdentifierField::fromFieldAndClass($identifier, $className);
556 556
             }
557 557
 
@@ -624,7 +624,7 @@  discard block
 block discarded – undo
624 624
      */
625 625
     public function persist($entity)
626 626
     {
627
-        if (! is_object($entity)) {
627
+        if ( ! is_object($entity)) {
628 628
             throw ORMInvalidArgumentException::invalidObject('EntityManager#persist()', $entity);
629 629
         }
630 630
 
@@ -646,7 +646,7 @@  discard block
 block discarded – undo
646 646
      */
647 647
     public function remove($entity)
648 648
     {
649
-        if (! is_object($entity)) {
649
+        if ( ! is_object($entity)) {
650 650
             throw ORMInvalidArgumentException::invalidObject('EntityManager#remove()', $entity);
651 651
         }
652 652
 
@@ -666,7 +666,7 @@  discard block
 block discarded – undo
666 666
      */
667 667
     public function refresh($entity)
668 668
     {
669
-        if (! is_object($entity)) {
669
+        if ( ! is_object($entity)) {
670 670
             throw ORMInvalidArgumentException::invalidObject('EntityManager#refresh()', $entity);
671 671
         }
672 672
 
@@ -821,7 +821,7 @@  discard block
 block discarded – undo
821 821
      */
822 822
     public static function create($connection, Configuration $config, ?EventManager $eventManager = null)
823 823
     {
824
-        if (! $config->getMetadataDriverImpl()) {
824
+        if ( ! $config->getMetadataDriverImpl()) {
825 825
             throw MissingMappingDriverImplementation::create();
826 826
         }
827 827
 
@@ -848,12 +848,12 @@  discard block
 block discarded – undo
848 848
             return DriverManager::getConnection($connection, $config, $eventManager ?: new EventManager());
849 849
         }
850 850
 
851
-        if (! $connection instanceof Connection) {
851
+        if ( ! $connection instanceof Connection) {
852 852
             throw new \InvalidArgumentException(
853 853
                 sprintf(
854 854
                     'Invalid $connection argument of type %s given%s.',
855 855
                     is_object($connection) ? get_class($connection) : gettype($connection),
856
-                    is_object($connection) ? '' : ': "' . $connection . '"'
856
+                    is_object($connection) ? '' : ': "'.$connection.'"'
857 857
                 )
858 858
             );
859 859
         }
@@ -901,13 +901,13 @@  discard block
 block discarded – undo
901 901
     {
902 902
         switch ($lockMode) {
903 903
             case LockMode::OPTIMISTIC:
904
-                if (! $class->isVersioned()) {
904
+                if ( ! $class->isVersioned()) {
905 905
                     throw OptimisticLockException::notVersioned($class->getClassName());
906 906
                 }
907 907
                 break;
908 908
             case LockMode::PESSIMISTIC_READ:
909 909
             case LockMode::PESSIMISTIC_WRITE:
910
-                if (! $this->getConnection()->isTransactionActive()) {
910
+                if ( ! $this->getConnection()->isTransactionActive()) {
911 911
                     throw TransactionRequiredException::transactionRequired();
912 912
                 }
913 913
         }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Query.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
 
257 257
         // Check query cache.
258 258
         $queryCache = $this->getQueryCacheDriver();
259
-        if (! ($this->useQueryCache && $queryCache)) {
259
+        if ( ! ($this->useQueryCache && $queryCache)) {
260 260
             $parser = new Parser($this);
261 261
 
262 262
             $this->parserResult = $parser->parse();
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
             $rsm   = $this->getResultSetMapping();
395 395
             $type  = null;
396 396
 
397
-            if (! isset($paramMappings[$key])) {
397
+            if ( ! isset($paramMappings[$key])) {
398 398
                 throw QueryException::unknownParameter($key);
399 399
             }
400 400
 
@@ -709,7 +709,7 @@  discard block
 block discarded – undo
709 709
     public function setLockMode($lockMode)
710 710
     {
711 711
         if (in_array($lockMode, [LockMode::NONE, LockMode::PESSIMISTIC_READ, LockMode::PESSIMISTIC_WRITE], true)) {
712
-            if (! $this->em->getConnection()->isTransactionActive()) {
712
+            if ( ! $this->em->getConnection()->isTransactionActive()) {
713 713
                 throw TransactionRequiredException::transactionRequired();
714 714
             }
715 715
         }
@@ -750,11 +750,11 @@  discard block
 block discarded – undo
750 750
             ->getName();
751 751
 
752 752
         return md5(
753
-            $this->getDQL() . serialize($this->hints) .
754
-            '&platform=' . $platform .
755
-            ($this->em->hasFilters() ? $this->em->getFilters()->getHash() : '') .
756
-            '&firstResult=' . $this->firstResult . '&maxResult=' . $this->maxResults .
757
-            '&hydrationMode=' . $this->hydrationMode . '&types=' . serialize($this->parsedTypes) . 'DOCTRINE_QUERY_CACHE_SALT'
753
+            $this->getDQL().serialize($this->hints).
754
+            '&platform='.$platform.
755
+            ($this->em->hasFilters() ? $this->em->getFilters()->getHash() : '').
756
+            '&firstResult='.$this->firstResult.'&maxResult='.$this->maxResults.
757
+            '&hydrationMode='.$this->hydrationMode.'&types='.serialize($this->parsedTypes).'DOCTRINE_QUERY_CACHE_SALT'
758 758
         );
759 759
     }
760 760
 
@@ -763,7 +763,7 @@  discard block
 block discarded – undo
763 763
      */
764 764
     protected function getHash()
765 765
     {
766
-        return sha1(parent::getHash() . '-' . $this->firstResult . '-' . $this->maxResults);
766
+        return sha1(parent::getHash().'-'.$this->firstResult.'-'.$this->maxResults);
767 767
     }
768 768
 
769 769
     /**
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Functional/Ticket/GH6443Test.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
         $entity = new GH6443Post();
36 36
         $entity->id = 'Foo';
37 37
 
38
-        $dql = 'SELECT p FROM ' . GH6443Post::class . ' p WHERE p = ?1';
38
+        $dql = 'SELECT p FROM '.GH6443Post::class.' p WHERE p = ?1';
39 39
         $query = $this->em->createQuery($dql);
40 40
 
41 41
         // we do not know that the internal type is a rot13, so we can not add the type parameter here
Please login to merge, or discard this patch.