@@ -38,9 +38,9 @@ |
||
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 | /** |
@@ -130,7 +130,7 @@ discard block |
||
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 | } |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | // root entity association |
276 | 276 | if ($rootAlias === $parentAlias) { |
277 | 277 | // Cancel put result if association put fail |
278 | - if ( ($assocInfo = $this->storeAssociationCache($key, $assoc, $assocValue)) === null) { |
|
278 | + if (($assocInfo = $this->storeAssociationCache($key, $assoc, $assocValue)) === null) { |
|
279 | 279 | return false; |
280 | 280 | } |
281 | 281 |
@@ -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 |
@@ -21,7 +21,6 @@ |
||
21 | 21 | |
22 | 22 | use Doctrine\Common\Collections\ArrayCollection; |
23 | 23 | use Doctrine\Common\Collections\Criteria; |
24 | - |
|
25 | 24 | use Doctrine\ORM\Query\Expr; |
26 | 25 | use Doctrine\ORM\Query\QueryExpressionVisitor; |
27 | 26 |
@@ -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 \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 | /** |
@@ -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 |
@@ -61,6 +61,6 @@ |
||
61 | 61 | $this->ownerIdentifier = $ownerIdentifier; |
62 | 62 | $this->entityClass = (string) $entityClass; |
63 | 63 | $this->association = (string) $association; |
64 | - $this->hash = str_replace('\\', '.', strtolower($entityClass)) . '_' . implode(' ', $ownerIdentifier) . '__' . $association; |
|
64 | + $this->hash = str_replace('\\', '.', strtolower($entityClass)).'_'.implode(' ', $ownerIdentifier).'__'.$association; |
|
65 | 65 | } |
66 | 66 | } |
@@ -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 | } |
@@ -45,7 +45,7 @@ |
||
45 | 45 | public function __construct($value, $time = null) |
46 | 46 | { |
47 | 47 | $this->value = $value; |
48 | - $this->time = $time ? : time(); |
|
48 | + $this->time = $time ?: time(); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | /** |
@@ -93,7 +93,7 @@ |
||
93 | 93 | return $this->collection->isEmpty(); |
94 | 94 | } |
95 | 95 | |
96 | - return !$this->count(); |
|
96 | + return ! $this->count(); |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | /** |
@@ -101,15 +101,15 @@ |
||
101 | 101 | return new self("Unrecognized field: $field"); |
102 | 102 | } |
103 | 103 | |
104 | - /** |
|
105 | - * |
|
106 | - * @param string $class |
|
107 | - * @param string $association |
|
108 | - * @param string $given |
|
109 | - * @param string $expected |
|
110 | - * |
|
111 | - * @return \Doctrine\ORM\ORMInvalidArgumentException |
|
112 | - */ |
|
104 | + /** |
|
105 | + * |
|
106 | + * @param string $class |
|
107 | + * @param string $association |
|
108 | + * @param string $given |
|
109 | + * @param string $expected |
|
110 | + * |
|
111 | + * @return \Doctrine\ORM\ORMInvalidArgumentException |
|
112 | + */ |
|
113 | 113 | public static function unexpectedAssociationValue($class, $association, $given, $expected) |
114 | 114 | { |
115 | 115 | return new self(sprintf('Found entity of type %s on association %s#%s, but expecting %s', $given, $class, $association, $expected)); |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | */ |
47 | 47 | public static function namedQueryNotFound($queryName) |
48 | 48 | { |
49 | - return new self('Could not find a named query by the name "' . $queryName . '"'); |
|
49 | + return new self('Could not find a named query by the name "'.$queryName.'"'); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | /** |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | */ |
57 | 57 | public static function namedNativeQueryNotFound($nativeQueryName) |
58 | 58 | { |
59 | - return new self('Could not find a named native query by the name "' . $nativeQueryName . '"'); |
|
59 | + return new self('Could not find a named native query by the name "'.$nativeQueryName.'"'); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | /** |
@@ -68,10 +68,10 @@ discard block |
||
68 | 68 | public static function entityMissingForeignAssignedId($entity, $relatedEntity) |
69 | 69 | { |
70 | 70 | return new self( |
71 | - "Entity of type " . get_class($entity) . " has identity through a foreign entity " . get_class($relatedEntity) . ", " . |
|
72 | - "however this entity has no identity itself. You have to call EntityManager#persist() on the related entity " . |
|
73 | - "and make sure that an identifier was generated before trying to persist '" . get_class($entity) . "'. In case " . |
|
74 | - "of Post Insert ID Generation (such as MySQL Auto-Increment) this means you have to call " . |
|
71 | + "Entity of type ".get_class($entity)." has identity through a foreign entity ".get_class($relatedEntity).", ". |
|
72 | + "however this entity has no identity itself. You have to call EntityManager#persist() on the related entity ". |
|
73 | + "and make sure that an identifier was generated before trying to persist '".get_class($entity)."'. In case ". |
|
74 | + "of Post Insert ID Generation (such as MySQL Auto-Increment) this means you have to call ". |
|
75 | 75 | "EntityManager#flush() between both persist operations." |
76 | 76 | ); |
77 | 77 | } |
@@ -84,9 +84,9 @@ discard block |
||
84 | 84 | */ |
85 | 85 | public static function entityMissingAssignedIdForField($entity, $field) |
86 | 86 | { |
87 | - return new self("Entity of type " . get_class($entity) . " is missing an assigned ID for field '" . $field . "'. " . |
|
87 | + return new self("Entity of type ".get_class($entity)." is missing an assigned ID for field '".$field."'. ". |
|
88 | 88 | "The identifier generation strategy for this entity requires the ID field to be populated before ". |
89 | - "EntityManager#persist() is called. If you want automatically generated identifiers instead " . |
|
89 | + "EntityManager#persist() is called. If you want automatically generated identifiers instead ". |
|
90 | 90 | "you need to adjust the metadata mapping accordingly." |
91 | 91 | ); |
92 | 92 | } |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | */ |
124 | 124 | public static function invalidOrientation($className, $field) |
125 | 125 | { |
126 | - return new self("Invalid order by orientation specified for " . $className . "#" . $field); |
|
126 | + return new self("Invalid order by orientation specified for ".$className."#".$field); |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | /** |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | */ |
241 | 241 | public static function queryCacheUsesNonPersistentCache(CacheDriver $cache) |
242 | 242 | { |
243 | - return new self('Query Cache uses a non-persistent cache driver, ' . get_class($cache) . '.'); |
|
243 | + return new self('Query Cache uses a non-persistent cache driver, '.get_class($cache).'.'); |
|
244 | 244 | } |
245 | 245 | |
246 | 246 | /** |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | */ |
251 | 251 | public static function metadataCacheUsesNonPersistentCache(CacheDriver $cache) |
252 | 252 | { |
253 | - return new self('Metadata Cache uses a non-persistent cache driver, ' . get_class($cache) . '.'); |
|
253 | + return new self('Metadata Cache uses a non-persistent cache driver, '.get_class($cache).'.'); |
|
254 | 254 | } |
255 | 255 | |
256 | 256 | /** |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | */ |
292 | 292 | public static function missingIdentifierField($className, $fieldName) |
293 | 293 | { |
294 | - return new self("The identifier $fieldName is missing for a query of " . $className); |
|
294 | + return new self("The identifier $fieldName is missing for a query of ".$className); |
|
295 | 295 | } |
296 | 296 | |
297 | 297 | /** |
@@ -303,8 +303,8 @@ discard block |
||
303 | 303 | public static function unrecognizedIdentifierFields($className, $fieldNames) |
304 | 304 | { |
305 | 305 | return new self( |
306 | - "Unrecognized identifier fields: '" . implode("', '", $fieldNames) . "' " . |
|
307 | - "are not present on class '" . $className . "'." |
|
306 | + "Unrecognized identifier fields: '".implode("', '", $fieldNames)."' ". |
|
307 | + "are not present on class '".$className."'." |
|
308 | 308 | ); |
309 | 309 | } |
310 | 310 |