@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | 9 => "St Julien" |
| 169 | 169 | ]; |
| 170 | 170 | |
| 171 | - $query = $this->_em |
|
| 171 | + $query = $this->_em |
|
| 172 | 172 | ->createQuery("SELECT a FROM Doctrine\Tests\Models\CMS\CmsAddress a WHERE a.city IN (:cities)") |
| 173 | 173 | ->setParameter('cities', $cities); |
| 174 | 174 | |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | */ |
| 185 | 185 | public function testProcessParameterValueClassMetadata() |
| 186 | 186 | { |
| 187 | - $query = $this->_em->createQuery("SELECT a FROM Doctrine\Tests\Models\CMS\CmsAddress a WHERE a.city IN (:cities)"); |
|
| 187 | + $query = $this->_em->createQuery("SELECT a FROM Doctrine\Tests\Models\CMS\CmsAddress a WHERE a.city IN (:cities)"); |
|
| 188 | 188 | $this->assertEquals( |
| 189 | 189 | CmsAddress::class, |
| 190 | 190 | $query->processParameterValue($this->_em->getClassMetadata(CmsAddress::class)) |
@@ -332,7 +332,7 @@ discard block |
||
| 332 | 332 | */ |
| 333 | 333 | public function testGetParameterTypeJuggling() : void |
| 334 | 334 | { |
| 335 | - $query = $this->_em->createQuery('select u from ' . CmsUser::class . ' u where u.id = ?0'); |
|
| 335 | + $query = $this->_em->createQuery('select u from '.CmsUser::class.' u where u.id = ?0'); |
|
| 336 | 336 | |
| 337 | 337 | $query->setParameter(0, 0); |
| 338 | 338 | |
@@ -346,7 +346,7 @@ discard block |
||
| 346 | 346 | */ |
| 347 | 347 | public function testSetParameterWithNameZeroIsNotOverridden() : void |
| 348 | 348 | { |
| 349 | - $query = $this->_em->createQuery('select u from ' . CmsUser::class . ' u where u.id != ?0 and u.username = :name'); |
|
| 349 | + $query = $this->_em->createQuery('select u from '.CmsUser::class.' u where u.id != ?0 and u.username = :name'); |
|
| 350 | 350 | |
| 351 | 351 | $query->setParameter(0, 0); |
| 352 | 352 | $query->setParameter('name', 'Doctrine'); |
@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | */ |
| 362 | 362 | public function testSetParameterWithNameZeroDoesNotOverrideAnotherParameter() : void |
| 363 | 363 | { |
| 364 | - $query = $this->_em->createQuery('select u from ' . CmsUser::class . ' u where u.id != ?0 and u.username = :name'); |
|
| 364 | + $query = $this->_em->createQuery('select u from '.CmsUser::class.' u where u.id != ?0 and u.username = :name'); |
|
| 365 | 365 | |
| 366 | 366 | $query->setParameter('name', 'Doctrine'); |
| 367 | 367 | $query->setParameter(0, 0); |
@@ -376,7 +376,7 @@ discard block |
||
| 376 | 376 | */ |
| 377 | 377 | public function testSetParameterWithTypeJugglingWorks() : void |
| 378 | 378 | { |
| 379 | - $query = $this->_em->createQuery('select u from ' . CmsUser::class . ' u where u.id != ?0 and u.username = :name'); |
|
| 379 | + $query = $this->_em->createQuery('select u from '.CmsUser::class.' u where u.id != ?0 and u.username = :name'); |
|
| 380 | 380 | |
| 381 | 381 | $query->setParameter('0', 1); |
| 382 | 382 | $query->setParameter('name', 'Doctrine'); |
@@ -396,7 +396,7 @@ discard block |
||
| 396 | 396 | { |
| 397 | 397 | $this->_em->getConfiguration()->setResultCacheImpl(new ArrayCache()); |
| 398 | 398 | |
| 399 | - $query = $this->_em->createQuery('SELECT u FROM ' . CmsUser::class . ' u'); |
|
| 399 | + $query = $this->_em->createQuery('SELECT u FROM '.CmsUser::class.' u'); |
|
| 400 | 400 | $query->useResultCache(true); |
| 401 | 401 | $query->setResultCacheProfile(); |
| 402 | 402 | |
@@ -414,7 +414,7 @@ discard block |
||
| 414 | 414 | ->expects(self::never()) |
| 415 | 415 | ->method('getSingleIdentifierValue'); |
| 416 | 416 | |
| 417 | - $query = $this->_em->createQuery('SELECT d FROM ' . DateTimeModel::class . ' d WHERE d.datetime = :value'); |
|
| 417 | + $query = $this->_em->createQuery('SELECT d FROM '.DateTimeModel::class.' d WHERE d.datetime = :value'); |
|
| 418 | 418 | |
| 419 | 419 | $query->setParameter('value', new DateTime(), Type::DATETIME); |
| 420 | 420 | |
@@ -57,8 +57,8 @@ |
||
| 57 | 57 | $this->parsedQueryWithDeclaredParameterType = $entityManager->createQuery($dql); |
| 58 | 58 | |
| 59 | 59 | foreach (range(1, 10) as $index) { |
| 60 | - $this->parsedQueryWithInferredParameterType->setParameter('parameter' . $index, new DateTime()); |
|
| 61 | - $this->parsedQueryWithDeclaredParameterType->setParameter('parameter' . $index, new DateTime(), DateTimeType::DATETIME); |
|
| 60 | + $this->parsedQueryWithInferredParameterType->setParameter('parameter'.$index, new DateTime()); |
|
| 61 | + $this->parsedQueryWithDeclaredParameterType->setParameter('parameter'.$index, new DateTime(), DateTimeType::DATETIME); |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | // Force parsing upfront - we don't benchmark that bit in this scenario |
@@ -19,12 +19,12 @@ discard block |
||
| 19 | 19 | { |
| 20 | 20 | $config = new Configuration(); |
| 21 | 21 | |
| 22 | - $config->setProxyDir(__DIR__ . '/../Tests/Proxies'); |
|
| 22 | + $config->setProxyDir(__DIR__.'/../Tests/Proxies'); |
|
| 23 | 23 | $config->setProxyNamespace('Doctrine\Tests\Proxies'); |
| 24 | 24 | $config->setAutoGenerateProxyClasses(ProxyFactory::AUTOGENERATE_EVAL); |
| 25 | 25 | $config->setMetadataDriverImpl($config->newDefaultAnnotationDriver([ |
| 26 | - realpath(__DIR__ . '/Models/Cache'), |
|
| 27 | - realpath(__DIR__ . '/Models/GeoNames'), |
|
| 26 | + realpath(__DIR__.'/Models/Cache'), |
|
| 27 | + realpath(__DIR__.'/Models/GeoNames'), |
|
| 28 | 28 | ], true)); |
| 29 | 29 | |
| 30 | 30 | $entityManager = EntityManager::create( |
@@ -45,13 +45,13 @@ discard block |
||
| 45 | 45 | { |
| 46 | 46 | $config = new Configuration(); |
| 47 | 47 | |
| 48 | - $config->setProxyDir(__DIR__ . '/../Tests/Proxies'); |
|
| 48 | + $config->setProxyDir(__DIR__.'/../Tests/Proxies'); |
|
| 49 | 49 | $config->setProxyNamespace('Doctrine\Tests\Proxies'); |
| 50 | 50 | $config->setAutoGenerateProxyClasses(ProxyFactory::AUTOGENERATE_EVAL); |
| 51 | 51 | $config->setMetadataDriverImpl($config->newDefaultAnnotationDriver([ |
| 52 | - realpath(__DIR__ . '/Models/Cache'), |
|
| 53 | - realpath(__DIR__ . '/Models/Generic'), |
|
| 54 | - realpath(__DIR__ . '/Models/GeoNames'), |
|
| 52 | + realpath(__DIR__.'/Models/Cache'), |
|
| 53 | + realpath(__DIR__.'/Models/Generic'), |
|
| 54 | + realpath(__DIR__.'/Models/GeoNames'), |
|
| 55 | 55 | ], true)); |
| 56 | 56 | |
| 57 | 57 | // A connection that doesn't really do anything |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | $expressionList[] = $this->dispatch($child); |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | - switch($expr->getType()) { |
|
| 117 | + switch ($expr->getType()) { |
|
| 118 | 118 | case CompositeExpression::TYPE_AND: |
| 119 | 119 | return new Expr\Andx($expressionList); |
| 120 | 120 | |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | return new Expr\Orx($expressionList); |
| 123 | 123 | |
| 124 | 124 | default: |
| 125 | - throw new \RuntimeException("Unknown composite " . $expr->getType()); |
|
| 125 | + throw new \RuntimeException("Unknown composite ".$expr->getType()); |
|
| 126 | 126 | } |
| 127 | 127 | } |
| 128 | 128 | |
@@ -136,10 +136,10 @@ discard block |
||
| 136 | 136 | throw new QueryException('No aliases are set before invoking walkComparison().'); |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | - $field = $this->queryAliases[0] . '.' . $comparison->getField(); |
|
| 139 | + $field = $this->queryAliases[0].'.'.$comparison->getField(); |
|
| 140 | 140 | |
| 141 | - foreach($this->queryAliases as $alias) { |
|
| 142 | - if(strpos($comparison->getField() . '.', $alias . '.') === 0) { |
|
| 141 | + foreach ($this->queryAliases as $alias) { |
|
| 142 | + if (strpos($comparison->getField().'.', $alias.'.') === 0) { |
|
| 143 | 143 | $field = $comparison->getField(); |
| 144 | 144 | break; |
| 145 | 145 | } |
@@ -149,13 +149,13 @@ discard block |
||
| 149 | 149 | |
| 150 | 150 | foreach ($this->parameters as $parameter) { |
| 151 | 151 | if ($parameter->getName() === $parameterName) { |
| 152 | - $parameterName .= '_' . count($this->parameters); |
|
| 152 | + $parameterName .= '_'.count($this->parameters); |
|
| 153 | 153 | break; |
| 154 | 154 | } |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | $parameter = new Parameter($parameterName, $this->walkValue($comparison->getValue())); |
| 158 | - $placeholder = ':' . $parameterName; |
|
| 158 | + $placeholder = ':'.$parameterName; |
|
| 159 | 159 | |
| 160 | 160 | switch ($comparison->getOperator()) { |
| 161 | 161 | case Comparison::IN: |
@@ -182,19 +182,19 @@ discard block |
||
| 182 | 182 | |
| 183 | 183 | return $this->expr->neq($field, $placeholder); |
| 184 | 184 | case Comparison::CONTAINS: |
| 185 | - $parameter->setValue('%' . $parameter->getValue() . '%', $parameter->getType()); |
|
| 185 | + $parameter->setValue('%'.$parameter->getValue().'%', $parameter->getType()); |
|
| 186 | 186 | $this->parameters[] = $parameter; |
| 187 | 187 | |
| 188 | 188 | return $this->expr->like($field, $placeholder); |
| 189 | 189 | case Comparison::MEMBER_OF: |
| 190 | 190 | return $this->expr->isMemberOf($comparison->getField(), $comparison->getValue()->getValue()); |
| 191 | 191 | case Comparison::STARTS_WITH: |
| 192 | - $parameter->setValue($parameter->getValue() . '%', $parameter->getType()); |
|
| 192 | + $parameter->setValue($parameter->getValue().'%', $parameter->getType()); |
|
| 193 | 193 | $this->parameters[] = $parameter; |
| 194 | 194 | |
| 195 | 195 | return $this->expr->like($field, $placeholder); |
| 196 | 196 | case Comparison::ENDS_WITH: |
| 197 | - $parameter->setValue('%' . $parameter->getValue(), $parameter->getType()); |
|
| 197 | + $parameter->setValue('%'.$parameter->getValue(), $parameter->getType()); |
|
| 198 | 198 | $this->parameters[] = $parameter; |
| 199 | 199 | |
| 200 | 200 | return $this->expr->like($field, $placeholder); |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | ); |
| 211 | 211 | } |
| 212 | 212 | |
| 213 | - throw new \RuntimeException("Unknown comparison operator: " . $comparison->getOperator()); |
|
| 213 | + throw new \RuntimeException("Unknown comparison operator: ".$comparison->getOperator()); |
|
| 214 | 214 | } |
| 215 | 215 | } |
| 216 | 216 | |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | */ |
| 106 | 106 | protected function onNotFoundMetadata($className) |
| 107 | 107 | { |
| 108 | - if (! $this->evm->hasListeners(Events::onClassMetadataNotFound)) { |
|
| 108 | + if ( ! $this->evm->hasListeners(Events::onClassMetadataNotFound)) { |
|
| 109 | 109 | return; |
| 110 | 110 | } |
| 111 | 111 | |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | $this->completeIdGeneratorMapping($class); |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | - if (!$class->isMappedSuperclass) { |
|
| 165 | + if ( ! $class->isMappedSuperclass) { |
|
| 166 | 166 | foreach ($class->embeddedClasses as $property => $embeddableClass) { |
| 167 | 167 | |
| 168 | 168 | if (isset($embeddableClass['inherited'])) { |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | |
| 188 | 188 | $identifier = $embeddableMetadata->getIdentifier(); |
| 189 | 189 | |
| 190 | - if (! empty($identifier)) { |
|
| 190 | + if ( ! empty($identifier)) { |
|
| 191 | 191 | $this->inheritIdGeneratorMapping($class, $embeddableMetadata); |
| 192 | 192 | } |
| 193 | 193 | |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | */ |
| 258 | 258 | protected function validateRuntimeMetadata($class, $parent) |
| 259 | 259 | { |
| 260 | - if ( ! $class->reflClass ) { |
|
| 260 | + if ( ! $class->reflClass) { |
|
| 261 | 261 | // only validate if there is a reflection class instance |
| 262 | 262 | return; |
| 263 | 263 | } |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | $class->validateLifecycleCallbacks($this->getReflectionService()); |
| 268 | 268 | |
| 269 | 269 | // verify inheritance |
| 270 | - if ( ! $class->isMappedSuperclass && !$class->isInheritanceTypeNone()) { |
|
| 270 | + if ( ! $class->isMappedSuperclass && ! $class->isInheritanceTypeNone()) { |
|
| 271 | 271 | if ( ! $parent) { |
| 272 | 272 | if (count($class->discriminatorMap) == 0) { |
| 273 | 273 | throw MappingException::missingDiscriminatorMap($class->name); |
@@ -428,7 +428,7 @@ discard block |
||
| 428 | 428 | { |
| 429 | 429 | foreach ($parentClass->associationMappings as $field => $mapping) { |
| 430 | 430 | if ($parentClass->isMappedSuperclass) { |
| 431 | - if ($mapping['type'] & ClassMetadata::TO_MANY && !$mapping['isOwningSide']) { |
|
| 431 | + if ($mapping['type'] & ClassMetadata::TO_MANY && ! $mapping['isOwningSide']) { |
|
| 432 | 432 | throw MappingException::illegalToManyAssociationOnMappedSuperclass($parentClass->name, $field); |
| 433 | 433 | } |
| 434 | 434 | $mapping['sourceEntity'] = $subClass->name; |
@@ -477,11 +477,11 @@ discard block |
||
| 477 | 477 | |
| 478 | 478 | $parentClass->mapEmbedded( |
| 479 | 479 | [ |
| 480 | - 'fieldName' => $prefix . '.' . $property, |
|
| 480 | + 'fieldName' => $prefix.'.'.$property, |
|
| 481 | 481 | 'class' => $embeddableMetadata->name, |
| 482 | 482 | 'columnPrefix' => $embeddableClass['columnPrefix'], |
| 483 | 483 | 'declaredField' => $embeddableClass['declaredField'] |
| 484 | - ? $prefix . '.' . $embeddableClass['declaredField'] |
|
| 484 | + ? $prefix.'.'.$embeddableClass['declaredField'] |
|
| 485 | 485 | : $prefix, |
| 486 | 486 | 'originalField' => $embeddableClass['originalField'] ?: $property, |
| 487 | 487 | ] |
@@ -499,7 +499,7 @@ discard block |
||
| 499 | 499 | */ |
| 500 | 500 | private function addInheritedIndexes(ClassMetadata $subClass, ClassMetadata $parentClass) |
| 501 | 501 | { |
| 502 | - if (! $parentClass->isMappedSuperclass) { |
|
| 502 | + if ( ! $parentClass->isMappedSuperclass) { |
|
| 503 | 503 | return; |
| 504 | 504 | } |
| 505 | 505 | |
@@ -707,14 +707,14 @@ discard block |
||
| 707 | 707 | throw new ORMException("Can't instantiate custom generator : no custom generator definition"); |
| 708 | 708 | } |
| 709 | 709 | if ( ! class_exists($definition['class'])) { |
| 710 | - throw new ORMException("Can't instantiate custom generator : " . |
|
| 710 | + throw new ORMException("Can't instantiate custom generator : ". |
|
| 711 | 711 | $definition['class']); |
| 712 | 712 | } |
| 713 | 713 | $class->setIdGenerator(new $definition['class']); |
| 714 | 714 | break; |
| 715 | 715 | |
| 716 | 716 | default: |
| 717 | - throw new ORMException("Unknown generator type: " . $class->generatorType); |
|
| 717 | + throw new ORMException("Unknown generator type: ".$class->generatorType); |
|
| 718 | 718 | } |
| 719 | 719 | } |
| 720 | 720 | |
@@ -764,7 +764,7 @@ discard block |
||
| 764 | 764 | */ |
| 765 | 765 | protected function getFqcnFromAlias($namespaceAlias, $simpleClassName) |
| 766 | 766 | { |
| 767 | - return $this->em->getConfiguration()->getEntityNamespace($namespaceAlias) . '\\' . $simpleClassName; |
|
| 767 | + return $this->em->getConfiguration()->getEntityNamespace($namespaceAlias).'\\'.$simpleClassName; |
|
| 768 | 768 | } |
| 769 | 769 | |
| 770 | 770 | /** |
@@ -788,7 +788,7 @@ discard block |
||
| 788 | 788 | */ |
| 789 | 789 | private function getTargetPlatform() |
| 790 | 790 | { |
| 791 | - if (!$this->targetPlatform) { |
|
| 791 | + if ( ! $this->targetPlatform) { |
|
| 792 | 792 | $this->targetPlatform = $this->em->getConnection()->getDatabasePlatform(); |
| 793 | 793 | } |
| 794 | 794 | |
@@ -70,7 +70,7 @@ |
||
| 70 | 70 | $returnableItems = []; |
| 71 | 71 | |
| 72 | 72 | foreach ($keysToRetrieve as $index => $key) { |
| 73 | - if (! $items[$key] instanceof CacheEntry) { |
|
| 73 | + if ( ! $items[$key] instanceof CacheEntry) { |
|
| 74 | 74 | return null; |
| 75 | 75 | } |
| 76 | 76 | |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | { |
| 97 | 97 | $entry = $this->cache->fetch($this->getCacheEntryKey($key)); |
| 98 | 98 | |
| 99 | - if (! $entry instanceof CacheEntry) { |
|
| 99 | + if ( ! $entry instanceof CacheEntry) { |
|
| 100 | 100 | return null; |
| 101 | 101 | } |
| 102 | 102 | |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | $entryKey = $this->getCacheEntryKey($key); |
| 115 | 115 | $entryValue = $this->cache->fetch($entryKey); |
| 116 | 116 | |
| 117 | - if (! $entryValue instanceof CacheEntry) { |
|
| 117 | + if ( ! $entryValue instanceof CacheEntry) { |
|
| 118 | 118 | return null; |
| 119 | 119 | } |
| 120 | 120 | |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | */ |
| 131 | 131 | protected function getCacheEntryKey(CacheKey $key) |
| 132 | 132 | { |
| 133 | - return $this->name . self::REGION_KEY_SEPARATOR . $key->hash; |
|
| 133 | + return $this->name.self::REGION_KEY_SEPARATOR.$key->hash; |
|
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | /** |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | */ |
| 155 | 155 | public function evictAll() |
| 156 | 156 | { |
| 157 | - if (! $this->cache instanceof ClearableCache) { |
|
| 157 | + if ( ! $this->cache instanceof ClearableCache) { |
|
| 158 | 158 | throw new \BadMethodCallException(sprintf( |
| 159 | 159 | 'Clearing all cache entries is not supported by the supplied cache adapter of type %s', |
| 160 | 160 | get_class($this->cache) |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | public function corruptedDataDoesNotLeakIntoApplicationWhenGettingSingleEntry() : void |
| 104 | 104 | { |
| 105 | 105 | $key1 = new CacheKeyMock('key.1'); |
| 106 | - $this->cache->save($this->region->getName() . '_' . $key1->hash, 'a-very-invalid-value'); |
|
| 106 | + $this->cache->save($this->region->getName().'_'.$key1->hash, 'a-very-invalid-value'); |
|
| 107 | 107 | |
| 108 | 108 | self::assertTrue($this->region->contains($key1)); |
| 109 | 109 | self::assertNull($this->region->get($key1)); |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | public function corruptedDataDoesNotLeakIntoApplicationWhenGettingMultipleEntries() : void |
| 117 | 117 | { |
| 118 | 118 | $key1 = new CacheKeyMock('key.1'); |
| 119 | - $this->cache->save($this->region->getName() . '_' . $key1->hash, 'a-very-invalid-value'); |
|
| 119 | + $this->cache->save($this->region->getName().'_'.$key1->hash, 'a-very-invalid-value'); |
|
| 120 | 120 | |
| 121 | 121 | self::assertTrue($this->region->contains($key1)); |
| 122 | 122 | self::assertNull($this->region->getMultiple(new CollectionCacheEntry([$key1]))); |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | public function corruptedDataDoesNotLeakIntoApplication() : void |
| 48 | 48 | { |
| 49 | 49 | $key1 = new CacheKeyMock('key.1'); |
| 50 | - $this->cache->save($this->region->getName() . '_' . $key1->hash, 'a-very-invalid-value'); |
|
| 50 | + $this->cache->save($this->region->getName().'_'.$key1->hash, 'a-very-invalid-value'); |
|
| 51 | 51 | |
| 52 | 52 | self::assertTrue($this->region->contains($key1)); |
| 53 | 53 | self::assertNull($this->region->getMultiple(new CollectionCacheEntry([$key1]))); |