@@ -12,11 +12,11 @@ |
||
12 | 12 | use Entities\Address; |
13 | 13 | use Entities\User; |
14 | 14 | |
15 | -$em = require_once __DIR__ . '/bootstrap.php'; |
|
15 | +$em = require_once __DIR__.'/bootstrap.php'; |
|
16 | 16 | |
17 | 17 | ## PUT YOUR TEST CODE BELOW |
18 | 18 | |
19 | 19 | $user = new User; |
20 | 20 | $address = new Address; |
21 | 21 | |
22 | -echo 'Hello World!' . PHP_EOL; |
|
22 | +echo 'Hello World!'.PHP_EOL; |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | foreach ($props as $name => $prop) { |
75 | 75 | $ident += 4; |
76 | 76 | $str .= str_repeat(' ', $ident) . '"' . $name . '": ' |
77 | - . $this->dump($prop) . ',' . PHP_EOL; |
|
77 | + . $this->dump($prop) . ',' . PHP_EOL; |
|
78 | 78 | $ident -= 4; |
79 | 79 | } |
80 | 80 | |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | |
87 | 87 | foreach ($obj as $k => $v) { |
88 | 88 | $str .= PHP_EOL . str_repeat(' ', $ident) . '"' |
89 | - . $k . '" => ' . $this->dump($v) . ','; |
|
89 | + . $k . '" => ' . $this->dump($v) . ','; |
|
90 | 90 | $some = true; |
91 | 91 | } |
92 | 92 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\ORM\Query\AST; |
6 | 6 | |
@@ -53,32 +53,32 @@ discard block |
||
53 | 53 | $str = ''; |
54 | 54 | |
55 | 55 | if ($obj instanceof Node) { |
56 | - $str .= get_class($obj) . '(' . PHP_EOL; |
|
56 | + $str .= get_class($obj).'('.PHP_EOL; |
|
57 | 57 | $props = get_object_vars($obj); |
58 | 58 | |
59 | 59 | foreach ($props as $name => $prop) { |
60 | 60 | $ident += 4; |
61 | - $str .= str_repeat(' ', $ident) . '"' . $name . '": ' |
|
62 | - . $this->dump($prop) . ',' . PHP_EOL; |
|
61 | + $str .= str_repeat(' ', $ident).'"'.$name.'": ' |
|
62 | + . $this->dump($prop).','.PHP_EOL; |
|
63 | 63 | $ident -= 4; |
64 | 64 | } |
65 | 65 | |
66 | - $str .= str_repeat(' ', $ident) . ')'; |
|
66 | + $str .= str_repeat(' ', $ident).')'; |
|
67 | 67 | } else if (is_array($obj)) { |
68 | 68 | $ident += 4; |
69 | 69 | $str .= 'array('; |
70 | 70 | $some = false; |
71 | 71 | |
72 | 72 | foreach ($obj as $k => $v) { |
73 | - $str .= PHP_EOL . str_repeat(' ', $ident) . '"' |
|
74 | - . $k . '" => ' . $this->dump($v) . ','; |
|
73 | + $str .= PHP_EOL.str_repeat(' ', $ident).'"' |
|
74 | + . $k.'" => '.$this->dump($v).','; |
|
75 | 75 | $some = true; |
76 | 76 | } |
77 | 77 | |
78 | 78 | $ident -= 4; |
79 | - $str .= ($some ? PHP_EOL . str_repeat(' ', $ident) : '') . ')'; |
|
79 | + $str .= ($some ? PHP_EOL . str_repeat(' ', $ident) : '').')'; |
|
80 | 80 | } else if (is_object($obj)) { |
81 | - $str .= 'instanceof(' . get_class($obj) . ')'; |
|
81 | + $str .= 'instanceof('.get_class($obj).')'; |
|
82 | 82 | } else { |
83 | 83 | $str .= var_export($obj, true); |
84 | 84 | } |
@@ -138,8 +138,8 @@ |
||
138 | 138 | public function __toString() |
139 | 139 | { |
140 | 140 | return strtoupper($this->joinType) . ' JOIN ' . $this->join |
141 | - . ($this->alias ? ' ' . $this->alias : '') |
|
142 | - . ($this->indexBy ? ' INDEX BY ' . $this->indexBy : '') |
|
143 | - . ($this->condition ? ' ' . strtoupper($this->conditionType) . ' ' . $this->condition : ''); |
|
141 | + . ($this->alias ? ' ' . $this->alias : '') |
|
142 | + . ($this->indexBy ? ' INDEX BY ' . $this->indexBy : '') |
|
143 | + . ($this->condition ? ' ' . strtoupper($this->conditionType) . ' ' . $this->condition : ''); |
|
144 | 144 | } |
145 | 145 | } |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\ORM\Query\Expr; |
6 | 6 | |
@@ -122,9 +122,9 @@ discard block |
||
122 | 122 | */ |
123 | 123 | public function __toString() |
124 | 124 | { |
125 | - return strtoupper($this->joinType) . ' JOIN ' . $this->join |
|
126 | - . ($this->alias ? ' ' . $this->alias : '') |
|
127 | - . ($this->indexBy ? ' INDEX BY ' . $this->indexBy : '') |
|
128 | - . ($this->condition ? ' ' . strtoupper($this->conditionType) . ' ' . $this->condition : ''); |
|
125 | + return strtoupper($this->joinType).' JOIN '.$this->join |
|
126 | + . ($this->alias ? ' '.$this->alias : '') |
|
127 | + . ($this->indexBy ? ' INDEX BY '.$this->indexBy : '') |
|
128 | + . ($this->condition ? ' '.strtoupper($this->conditionType).' '.$this->condition : ''); |
|
129 | 129 | } |
130 | 130 | } |
@@ -227,7 +227,9 @@ |
||
227 | 227 | $found = false; |
228 | 228 | |
229 | 229 | foreach (array_merge($this->metaMappings, $this->fieldMappings) as $columnName => $columnFieldName) { |
230 | - if ( ! ($columnFieldName === $fieldName && $this->columnOwnerMap[$columnName] === $alias)) continue; |
|
230 | + if ( ! ($columnFieldName === $fieldName && $this->columnOwnerMap[$columnName] === $alias)) { |
|
231 | + continue; |
|
232 | + } |
|
231 | 233 | |
232 | 234 | $this->addIndexByColumn($alias, $columnName); |
233 | 235 | $found = true; |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\ORM\Query; |
6 | 6 |
@@ -212,10 +212,10 @@ |
||
212 | 212 | } |
213 | 213 | |
214 | 214 | /** |
215 | - * Obtain the name of the second level query cache region in which query results will be stored |
|
216 | - * |
|
217 | - * @return string|null The cache region name; NULL indicates the default region. |
|
218 | - */ |
|
215 | + * Obtain the name of the second level query cache region in which query results will be stored |
|
216 | + * |
|
217 | + * @return string|null The cache region name; NULL indicates the default region. |
|
218 | + */ |
|
219 | 219 | public function getCacheRegion() |
220 | 220 | { |
221 | 221 | return $this->cacheRegion; |
@@ -1,11 +1,11 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\ORM; |
6 | 6 | |
7 | 7 | use Doctrine\Common\Collections\Collection; |
8 | -use Doctrine\Common\Collections\ArrayCollection;; |
|
8 | +use Doctrine\Common\Collections\ArrayCollection; ; |
|
9 | 9 | use Doctrine\ORM\Query\Parameter; |
10 | 10 | use Doctrine\ORM\Cache\QueryCacheKey; |
11 | 11 | use Doctrine\DBAL\Cache\QueryCacheProfile; |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | public function getParameter($key) |
306 | 306 | { |
307 | 307 | $filteredParameters = $this->parameters->filter( |
308 | - function (Query\Parameter $parameter) use ($key) : bool { |
|
308 | + function(Query\Parameter $parameter) use ($key) : bool { |
|
309 | 309 | $parameterName = $parameter->getName(); |
310 | 310 | |
311 | 311 | return $key === $parameterName || (string) $key === (string) $parameterName; |
@@ -443,7 +443,7 @@ discard block |
||
443 | 443 | */ |
444 | 444 | private function translateNamespaces(Query\ResultSetMapping $rsm) |
445 | 445 | { |
446 | - $translate = function ($alias) { |
|
446 | + $translate = function($alias) { |
|
447 | 447 | return $this->em->getClassMetadata($alias)->getClassName(); |
448 | 448 | }; |
449 | 449 | |
@@ -505,7 +505,7 @@ discard block |
||
505 | 505 | */ |
506 | 506 | public function setResultCacheProfile(QueryCacheProfile $profile = null) |
507 | 507 | { |
508 | - if (! $profile->getResultCacheDriver()) { |
|
508 | + if ( ! $profile->getResultCacheDriver()) { |
|
509 | 509 | $resultCacheDriver = $this->em->getConfiguration()->getResultCacheImpl(); |
510 | 510 | $profile = $profile->setResultCacheDriver($resultCacheDriver); |
511 | 511 | } |
@@ -973,7 +973,7 @@ discard block |
||
973 | 973 | $this->getTimestampKey() |
974 | 974 | ); |
975 | 975 | |
976 | - $result = $queryCache->get($queryKey, $rsm, $this->hints); |
|
976 | + $result = $queryCache->get($queryKey, $rsm, $this->hints); |
|
977 | 977 | |
978 | 978 | if ($result !== null) { |
979 | 979 | if ($this->cacheLogger) { |
@@ -1107,6 +1107,6 @@ discard block |
||
1107 | 1107 | |
1108 | 1108 | ksort($hints); |
1109 | 1109 | |
1110 | - return sha1($query . '-' . serialize($params) . '-' . serialize($hints)); |
|
1110 | + return sha1($query.'-'.serialize($params).'-'.serialize($hints)); |
|
1111 | 1111 | } |
1112 | 1112 | } |
@@ -45,9 +45,9 @@ discard block |
||
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 |
||
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)) { |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | |
4 | -declare(strict_types=1); |
|
4 | +declare(strict_types = 1); |
|
5 | 5 | |
6 | 6 | namespace Doctrine\ORM\Cache; |
7 | 7 | |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | |
206 | 206 | foreach ($metadatas as $metadata) { |
207 | 207 | foreach ($metadata->getDeclaredPropertiesIterator() as $association) { |
208 | - if (! $association instanceof ToManyAssociationMetadata) { |
|
208 | + if ( ! $association instanceof ToManyAssociationMetadata) { |
|
209 | 209 | continue; |
210 | 210 | } |
211 | 211 | |
@@ -262,8 +262,7 @@ discard block |
||
262 | 262 | public function getQueryCache($regionName = null) |
263 | 263 | { |
264 | 264 | if ($regionName === null) { |
265 | - return $this->defaultQueryCache ?: |
|
266 | - $this->defaultQueryCache = $this->cacheFactory->buildQueryCache($this->em); |
|
265 | + return $this->defaultQueryCache ?: $this->defaultQueryCache = $this->cacheFactory->buildQueryCache($this->em); |
|
267 | 266 | } |
268 | 267 | |
269 | 268 | if ( ! isset($this->queryCaches[$regionName])) { |
@@ -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 | /** |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | |
4 | -declare(strict_types=1); |
|
4 | +declare(strict_types = 1); |
|
5 | 5 | |
6 | 6 | namespace Doctrine\ORM\Cache; |
7 | 7 | |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | |
102 | 102 | $cm = $this->em->getClassMetadata($entityName); |
103 | 103 | |
104 | - $generateKeys = function (array $entry) use ($cm): EntityCacheKey { |
|
104 | + $generateKeys = function(array $entry) use ($cm): EntityCacheKey { |
|
105 | 105 | return new EntityCacheKey($cm->getRootClassName(), $entry['identifier']); |
106 | 106 | }; |
107 | 107 | |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | continue; |
173 | 173 | } |
174 | 174 | |
175 | - $generateKeys = function ($id) use ($assocMetadata): EntityCacheKey { |
|
175 | + $generateKeys = function($id) use ($assocMetadata): EntityCacheKey { |
|
176 | 176 | return new EntityCacheKey($assocMetadata->getRootClassName(), $id); |
177 | 177 | }; |
178 | 178 | |
@@ -336,9 +336,9 @@ discard block |
||
336 | 336 | $assocIdentifier = $this->uow->getEntityIdentifier($assocValue); |
337 | 337 | $entityKey = new EntityCacheKey($assocMetadata->getRootClassName(), $assocIdentifier); |
338 | 338 | |
339 | - if ((! $assocValue instanceof GhostObjectInterface && ($key->cacheMode & Cache::MODE_REFRESH)) || ! $assocRegion->contains($entityKey)) { |
|
339 | + if (( ! $assocValue instanceof GhostObjectInterface && ($key->cacheMode & Cache::MODE_REFRESH)) || ! $assocRegion->contains($entityKey)) { |
|
340 | 340 | // Entity put fail |
341 | - if (! $assocPersister->storeEntityCache($assocValue, $entityKey)) { |
|
341 | + if ( ! $assocPersister->storeEntityCache($assocValue, $entityKey)) { |
|
342 | 342 | return null; |
343 | 343 | } |
344 | 344 | } |
@@ -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 | /** |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | |
4 | -declare(strict_types=1); |
|
4 | +declare(strict_types = 1); |
|
5 | 5 | |
6 | 6 | namespace Doctrine\ORM\Cache\Logging; |
7 | 7 |
@@ -143,7 +143,7 @@ |
||
143 | 143 | $code = $this->generateEntityRepositoryClass($fullClassName); |
144 | 144 | |
145 | 145 | $path = $outputDirectory . DIRECTORY_SEPARATOR |
146 | - . str_replace('\\', \DIRECTORY_SEPARATOR, $fullClassName) . '.php'; |
|
146 | + . str_replace('\\', \DIRECTORY_SEPARATOR, $fullClassName) . '.php'; |
|
147 | 147 | $dir = dirname($path); |
148 | 148 | |
149 | 149 | if ( ! is_dir($dir)) { |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\ORM\Tools; |
6 | 6 | |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | { |
99 | 99 | $namespace = $this->getClassNamespace($fullClassName); |
100 | 100 | |
101 | - return $namespace ? 'namespace ' . $namespace . ';' : ''; |
|
101 | + return $namespace ? 'namespace '.$namespace.';' : ''; |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | /** |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | $repositoryName = $this->repositoryName ?: EntityRepository::class; |
114 | 114 | |
115 | 115 | if ($namespace && $repositoryName[0] !== '\\') { |
116 | - $repositoryName = '\\' . $repositoryName; |
|
116 | + $repositoryName = '\\'.$repositoryName; |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | return $repositoryName; |
@@ -129,8 +129,8 @@ discard block |
||
129 | 129 | { |
130 | 130 | $code = $this->generateEntityRepositoryClass($fullClassName); |
131 | 131 | |
132 | - $path = $outputDirectory . DIRECTORY_SEPARATOR |
|
133 | - . str_replace('\\', \DIRECTORY_SEPARATOR, $fullClassName) . '.php'; |
|
132 | + $path = $outputDirectory.DIRECTORY_SEPARATOR |
|
133 | + . str_replace('\\', \DIRECTORY_SEPARATOR, $fullClassName).'.php'; |
|
134 | 134 | $dir = dirname($path); |
135 | 135 | |
136 | 136 | if ( ! is_dir($dir)) { |