@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | */ |
74 | 74 | public function getCacheLogger() |
75 | 75 | { |
76 | - return $this->cacheLogger; |
|
76 | + return $this->cacheLogger; |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | /** |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | $this->queryValidator = new TimestampQueryCacheValidator(); |
114 | 114 | } |
115 | 115 | |
116 | - return $this->queryValidator; |
|
116 | + return $this->queryValidator; |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | /** |
@@ -56,12 +56,12 @@ |
||
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 \Shitty\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 \Shitty\ORM\Cache\CollectionCacheKey $key The cache key of the collection. |
|
64 | + */ |
|
65 | 65 | public function collectionCachePut($regionName, CollectionCacheKey $key); |
66 | 66 | |
67 | 67 | /** |
@@ -37,9 +37,9 @@ discard block |
||
37 | 37 | */ |
38 | 38 | abstract class AbstractCollectionPersister implements CachedCollectionPersister |
39 | 39 | { |
40 | - /** |
|
41 | - * @var \Shitty\ORM\UnitOfWork |
|
42 | - */ |
|
40 | + /** |
|
41 | + * @var \Shitty\ORM\UnitOfWork |
|
42 | + */ |
|
43 | 43 | protected $uow; |
44 | 44 | |
45 | 45 | /** |
@@ -67,9 +67,9 @@ discard block |
||
67 | 67 | */ |
68 | 68 | protected $association; |
69 | 69 | |
70 | - /** |
|
71 | - * @var array |
|
72 | - */ |
|
70 | + /** |
|
71 | + * @var array |
|
72 | + */ |
|
73 | 73 | protected $queuedCache = array(); |
74 | 74 | |
75 | 75 | /** |
@@ -715,9 +715,9 @@ |
||
715 | 715 | ); |
716 | 716 | } |
717 | 717 | |
718 | - /** |
|
719 | - * {@inheritdoc} |
|
720 | - */ |
|
718 | + /** |
|
719 | + * {@inheritdoc} |
|
720 | + */ |
|
721 | 721 | protected function getHash() |
722 | 722 | { |
723 | 723 | return sha1(parent::getHash(). '-'. $this->_firstResult . '-' . $this->_maxResults); |
@@ -85,7 +85,7 @@ |
||
85 | 85 | $ownerId = $this->uow->getEntityIdentifier($collection->getOwner()); |
86 | 86 | $key = new CollectionCacheKey($this->sourceEntity->rootEntityName, $this->association['fieldName'], $ownerId); |
87 | 87 | |
88 | - // Invalidate non initialized collections OR ordered collection |
|
88 | + // Invalidate non initialized collections OR ordered collection |
|
89 | 89 | if ($isDirty && ! $isInitialized || isset($this->association['orderBy'])) { |
90 | 90 | $this->persister->update($collection); |
91 | 91 |
@@ -45,9 +45,9 @@ discard block |
||
45 | 45 | */ |
46 | 46 | private $uow; |
47 | 47 | |
48 | - /** |
|
49 | - * @var \Shitty\ORM\Cache\CacheFactory |
|
50 | - */ |
|
48 | + /** |
|
49 | + * @var \Shitty\ORM\Cache\CacheFactory |
|
50 | + */ |
|
51 | 51 | private $cacheFactory; |
52 | 52 | |
53 | 53 | /** |
@@ -289,12 +289,12 @@ discard block |
||
289 | 289 | return $this->queryCaches[$regionName]; |
290 | 290 | } |
291 | 291 | |
292 | - /** |
|
293 | - * @param \Shitty\ORM\Mapping\ClassMetadata $metadata The entity metadata. |
|
294 | - * @param mixed $identifier The entity identifier. |
|
295 | - * |
|
296 | - * @return \Shitty\ORM\Cache\EntityCacheKey |
|
297 | - */ |
|
292 | + /** |
|
293 | + * @param \Shitty\ORM\Mapping\ClassMetadata $metadata The entity metadata. |
|
294 | + * @param mixed $identifier The entity identifier. |
|
295 | + * |
|
296 | + * @return \Shitty\ORM\Cache\EntityCacheKey |
|
297 | + */ |
|
298 | 298 | private function buildEntityCacheKey(ClassMetadata $metadata, $identifier) |
299 | 299 | { |
300 | 300 | if ( ! is_array($identifier)) { |
@@ -278,8 +278,7 @@ discard block |
||
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 |
||
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); |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | |
110 | 110 | $targetAssoc = $targetClassMetadata->associationMappings[$fieldName]; |
111 | 111 | |
112 | - foreach($assoc['targetToSourceKeyColumns'] as $referencedColumn => $localColumn) { |
|
112 | + foreach ($assoc['targetToSourceKeyColumns'] as $referencedColumn => $localColumn) { |
|
113 | 113 | if (isset($targetAssoc['sourceToTargetKeyColumns'][$referencedColumn])) { |
114 | 114 | $data[$localColumn] = $fieldValue; |
115 | 115 | } |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | } |
162 | 162 | |
163 | 163 | foreach ($metadata->associationMappings as $name => $assoc) { |
164 | - if ( ! isset($assoc['cache']) || ! isset($data[$name])) { |
|
164 | + if ( ! isset($assoc['cache']) || ! isset($data[$name])) { |
|
165 | 165 | continue; |
166 | 166 | } |
167 | 167 |
@@ -52,6 +52,6 @@ |
||
52 | 52 | |
53 | 53 | $this->identifier = $identifier; |
54 | 54 | $this->entityClass = $entityClass; |
55 | - $this->hash = str_replace('\\', '.', strtolower($entityClass) . '_' . implode(' ', $identifier)); |
|
55 | + $this->hash = str_replace('\\', '.', strtolower($entityClass).'_'.implode(' ', $identifier)); |
|
56 | 56 | } |
57 | 57 | } |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | $expectedLockVersion = ($expectedLockVersion instanceof \DateTime) ? $expectedLockVersion->getTimestamp() : $expectedLockVersion; |
77 | 77 | $actualLockVersion = ($actualLockVersion instanceof \DateTime) ? $actualLockVersion->getTimestamp() : $actualLockVersion; |
78 | 78 | |
79 | - return new self("The optimistic lock failed, version " . $expectedLockVersion . " was expected, but is actually ".$actualLockVersion, $entity); |
|
79 | + return new self("The optimistic lock failed, version ".$expectedLockVersion." was expected, but is actually ".$actualLockVersion, $entity); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | /** |
@@ -86,6 +86,6 @@ discard block |
||
86 | 86 | */ |
87 | 87 | public static function notVersioned($entityName) |
88 | 88 | { |
89 | - return new self("Cannot obtain optimistic lock on unversioned entity " . $entityName, null); |
|
89 | + return new self("Cannot obtain optimistic lock on unversioned entity ".$entityName, null); |
|
90 | 90 | } |
91 | 91 | } |