Completed
Pull Request — 2.5 (#7639)
by
unknown
03:04
created
lib/Doctrine/ORM/Utility/PersisterHelper.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
 
56 56
         $assoc = $class->associationMappings[$fieldName];
57 57
 
58
-        if (! $assoc['isOwningSide']) {
58
+        if ( ! $assoc['isOwningSide']) {
59 59
             return self::getTypeOfField($assoc['mappedBy'], $em->getClassMetadata($assoc['targetEntity']), $em);
60 60
         }
61 61
 
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,6 @@
 block discarded – undo
20 20
 
21 21
 namespace Doctrine\ORM\Utility;
22 22
 
23
-use Doctrine\Common\Util\ClassUtils;
24 23
 use Doctrine\ORM\EntityManagerInterface;
25 24
 use Doctrine\ORM\Mapping\ClassMetadata;
26 25
 use Doctrine\ORM\Query\QueryException;
Please login to merge, or discard this patch.
lib/Doctrine/ORM/EntityManager.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -839,7 +839,7 @@
 block discarded – undo
839 839
 
840 840
             case ($conn instanceof Connection):
841 841
                 if ($eventManager !== null && $conn->getEventManager() !== $eventManager) {
842
-                     throw ORMException::mismatchedEventManager();
842
+                        throw ORMException::mismatchedEventManager();
843 843
                 }
844 844
                 break;
845 845
 
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -223,8 +223,8 @@  discard block
 block discarded – undo
223 223
      */
224 224
     public function transactional($func)
225 225
     {
226
-        if (!is_callable($func)) {
227
-            throw new \InvalidArgumentException('Expected argument of type "callable", got "' . gettype($func) . '"');
226
+        if ( ! is_callable($func)) {
227
+            throw new \InvalidArgumentException('Expected argument of type "callable", got "'.gettype($func).'"');
228 228
         }
229 229
 
230 230
         $this->conn->beginTransaction();
@@ -571,7 +571,7 @@  discard block
 block discarded – undo
571 571
     public function persist($entity)
572 572
     {
573 573
         if ( ! is_object($entity)) {
574
-            throw ORMInvalidArgumentException::invalidObject('EntityManager#persist()' , $entity);
574
+            throw ORMInvalidArgumentException::invalidObject('EntityManager#persist()', $entity);
575 575
         }
576 576
 
577 577
         $this->errorIfClosed();
@@ -594,7 +594,7 @@  discard block
 block discarded – undo
594 594
     public function remove($entity)
595 595
     {
596 596
         if ( ! is_object($entity)) {
597
-            throw ORMInvalidArgumentException::invalidObject('EntityManager#remove()' , $entity);
597
+            throw ORMInvalidArgumentException::invalidObject('EntityManager#remove()', $entity);
598 598
         }
599 599
 
600 600
         $this->errorIfClosed();
@@ -615,7 +615,7 @@  discard block
 block discarded – undo
615 615
     public function refresh($entity)
616 616
     {
617 617
         if ( ! is_object($entity)) {
618
-            throw ORMInvalidArgumentException::invalidObject('EntityManager#refresh()' , $entity);
618
+            throw ORMInvalidArgumentException::invalidObject('EntityManager#refresh()', $entity);
619 619
         }
620 620
 
621 621
         $this->errorIfClosed();
@@ -639,7 +639,7 @@  discard block
 block discarded – undo
639 639
     public function detach($entity)
640 640
     {
641 641
         if ( ! is_object($entity)) {
642
-            throw ORMInvalidArgumentException::invalidObject('EntityManager#detach()' , $entity);
642
+            throw ORMInvalidArgumentException::invalidObject('EntityManager#detach()', $entity);
643 643
         }
644 644
 
645 645
         $this->unitOfWork->detach($entity);
@@ -659,7 +659,7 @@  discard block
 block discarded – undo
659 659
     public function merge($entity)
660 660
     {
661 661
         if ( ! is_object($entity)) {
662
-            throw ORMInvalidArgumentException::invalidObject('EntityManager#merge()' , $entity);
662
+            throw ORMInvalidArgumentException::invalidObject('EntityManager#merge()', $entity);
663 663
         }
664 664
 
665 665
         $this->errorIfClosed();
@@ -747,7 +747,7 @@  discard block
 block discarded – undo
747 747
      */
748 748
     public function isOpen()
749 749
     {
750
-        return (!$this->closed);
750
+        return ( ! $this->closed);
751 751
     }
752 752
 
753 753
     /**
@@ -844,7 +844,7 @@  discard block
 block discarded – undo
844 844
                 break;
845 845
 
846 846
             default:
847
-                throw new \InvalidArgumentException("Invalid argument: " . $conn);
847
+                throw new \InvalidArgumentException("Invalid argument: ".$conn);
848 848
         }
849 849
 
850 850
         return new EntityManager($conn, $config, $conn->getEventManager());
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Cache/DefaultCache.php 2 patches
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -45,9 +45,9 @@  discard block
 block discarded – undo
45 45
      */
46 46
     private $uow;
47 47
 
48
-     /**
49
-     * @var \Doctrine\ORM\Cache\CacheFactory
50
-     */
48
+        /**
49
+         * @var \Doctrine\ORM\Cache\CacheFactory
50
+         */
51 51
     private $cacheFactory;
52 52
 
53 53
     /**
@@ -289,12 +289,12 @@  discard block
 block discarded – undo
289 289
         return $this->queryCaches[$regionName];
290 290
     }
291 291
 
292
-     /**
293
-     * @param \Doctrine\ORM\Mapping\ClassMetadata $metadata   The entity metadata.
294
-     * @param mixed                               $identifier The entity identifier.
295
-     *
296
-     * @return \Doctrine\ORM\Cache\EntityCacheKey
297
-     */
292
+        /**
293
+         * @param \Doctrine\ORM\Mapping\ClassMetadata $metadata   The entity metadata.
294
+         * @param mixed                               $identifier The entity identifier.
295
+         *
296
+         * @return \Doctrine\ORM\Cache\EntityCacheKey
297
+         */
298 298
     private function buildEntityCacheKey(ClassMetadata $metadata, $identifier)
299 299
     {
300 300
         if ( ! is_array($identifier)) {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -278,8 +278,7 @@  discard block
 block discarded – undo
278 278
     public function getQueryCache($regionName = null)
279 279
     {
280 280
         if ($regionName === null) {
281
-            return $this->defaultQueryCache ?:
282
-                $this->defaultQueryCache = $this->cacheFactory->buildQueryCache($this->em);
281
+            return $this->defaultQueryCache ?: $this->defaultQueryCache = $this->cacheFactory->buildQueryCache($this->em);
283 282
         }
284 283
 
285 284
         if ( ! isset($this->queryCaches[$regionName])) {
@@ -314,7 +313,7 @@  discard block
 block discarded – undo
314 313
     private function buildCollectionCacheKey(ClassMetadata $metadata, $association, $ownerIdentifier)
315 314
     {
316 315
         if ( ! is_array($ownerIdentifier)) {
317
-            $ownerIdentifier = $this->toIdentifierArray($metadata, $ownerIdentifier);;
316
+            $ownerIdentifier = $this->toIdentifierArray($metadata, $ownerIdentifier); ;
318 317
         }
319 318
 
320 319
         return new CollectionCacheKey($metadata->rootEntityName, $association, $ownerIdentifier);
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Cache/DefaultCacheFactory.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -217,12 +217,12 @@
 block discarded – undo
217 217
 
218 218
             if ( ! $this->fileLockRegionDirectory) {
219 219
                 throw new \LogicException(
220
-                    'If you what to use a "READ_WRITE" cache an implementation of "Doctrine\ORM\Cache\ConcurrentRegion" is required, ' .
220
+                    'If you what to use a "READ_WRITE" cache an implementation of "Doctrine\ORM\Cache\ConcurrentRegion" is required, '.
221 221
                     'The default implementation provided by doctrine is "Doctrine\ORM\Cache\Region\FileLockRegion" if you what to use it please provide a valid directory, DefaultCacheFactory#setFileLockRegionDirectory(). '
222 222
                 );
223 223
             }
224 224
 
225
-            $directory = $this->fileLockRegionDirectory . DIRECTORY_SEPARATOR . $cache['region'];
225
+            $directory = $this->fileLockRegionDirectory.DIRECTORY_SEPARATOR.$cache['region'];
226 226
             $region    = new FileLockRegion($region, $directory, $this->regionsConfig->getLockLifetime($cache['region']));
227 227
         }
228 228
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Cache/Region/DefaultRegion.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
      */
125 125
     protected function getCacheEntryKey(CacheKey $key)
126 126
     {
127
-        return $this->name . self::REGION_KEY_SEPARATOR . $key->hash;
127
+        return $this->name.self::REGION_KEY_SEPARATOR.$key->hash;
128 128
     }
129 129
 
130 130
     /**
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
      */
149 149
     public function evictAll()
150 150
     {
151
-        if (! $this->cache instanceof ClearableCache) {
151
+        if ( ! $this->cache instanceof ClearableCache) {
152 152
             throw new \BadMethodCallException(sprintf(
153 153
                 'Clearing all cache entries is not supported by the supplied cache adapter of type %s',
154 154
                 get_class($this->cache)
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Cache/Region/FileLockRegion.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
      */
119 119
     private function getLockFileName(CacheKey $key)
120 120
     {
121
-        return $this->directory . DIRECTORY_SEPARATOR . $key->hash . '.' . self::LOCK_EXTENSION;
121
+        return $this->directory.DIRECTORY_SEPARATOR.$key->hash.'.'.self::LOCK_EXTENSION;
122 122
     }
123 123
 
124 124
     /**
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
     {
217 217
         // The check below is necessary because on some platforms glob returns false
218 218
         // when nothing matched (even though no errors occurred)
219
-        $filenames = glob(sprintf("%s/*.%s" , $this->directory, self::LOCK_EXTENSION));
219
+        $filenames = glob(sprintf("%s/*.%s", $this->directory, self::LOCK_EXTENSION));
220 220
 
221 221
         if ($filenames) {
222 222
             foreach ($filenames as $filename) {
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Cache/DefaultQueryCache.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -38,9 +38,9 @@
 block discarded – undo
38 38
  */
39 39
 class DefaultQueryCache implements QueryCache
40 40
 {
41
-     /**
42
-     * @var \Doctrine\ORM\EntityManagerInterface
43
-     */
41
+        /**
42
+         * @var \Doctrine\ORM\EntityManagerInterface
43
+         */
44 44
     private $em;
45 45
 
46 46
     /**
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -130,7 +130,7 @@
 block discarded – undo
130 130
 
131 131
             if ( ! $hasRelation) {
132 132
 
133
-                $result[$index]  = $this->uow->createEntity($entityEntry->class, $entityEntry->resolveAssociationEntries($this->em), self::$hints);
133
+                $result[$index] = $this->uow->createEntity($entityEntry->class, $entityEntry->resolveAssociationEntries($this->em), self::$hints);
134 134
 
135 135
                 continue;
136 136
             }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Cache/Logging/CacheLogger.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -56,12 +56,12 @@
 block discarded – undo
56 56
      */
57 57
     public function entityCacheMiss($regionName, EntityCacheKey $key);
58 58
 
59
-     /**
60
-     * Log an entity put into second level cache.
61
-     *
62
-     * @param string                                 $regionName The name of the cache region.
63
-     * @param \Doctrine\ORM\Cache\CollectionCacheKey $key        The cache key of the collection.
64
-     */
59
+        /**
60
+         * Log an entity put into second level cache.
61
+         *
62
+         * @param string                                 $regionName The name of the cache region.
63
+         * @param \Doctrine\ORM\Cache\CollectionCacheKey $key        The cache key of the collection.
64
+         */
65 65
     public function collectionCachePut($regionName, CollectionCacheKey $key);
66 66
 
67 67
     /**
Please login to merge, or discard this patch.
ORM/Cache/Persister/Collection/ReadOnlyCachedCollectionPersister.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,9 +30,9 @@
 block discarded – undo
30 30
  */
31 31
 class ReadOnlyCachedCollectionPersister extends NonStrictReadWriteCachedCollectionPersister
32 32
 {
33
-     /**
34
-     * {@inheritdoc}
35
-     */
33
+        /**
34
+         * {@inheritdoc}
35
+         */
36 36
     public function update(PersistentCollection $collection)
37 37
     {
38 38
         if ($collection->isDirty() && count($collection->getSnapshot()) > 0) {
Please login to merge, or discard this patch.