@@ -49,10 +49,10 @@ discard block |
||
49 | 49 | $tableName = $class->table['name']; |
50 | 50 | |
51 | 51 | if ( ! empty($class->table['schema'])) { |
52 | - $tableName = $class->table['schema'] . '.' . $class->table['name']; |
|
52 | + $tableName = $class->table['schema'].'.'.$class->table['name']; |
|
53 | 53 | |
54 | 54 | if ( ! $platform->supportsSchemas() && $platform->canEmulateSchemas()) { |
55 | - $tableName = $class->table['schema'] . '__' . $class->table['name']; |
|
55 | + $tableName = $class->table['schema'].'__'.$class->table['name']; |
|
56 | 56 | } |
57 | 57 | } |
58 | 58 | |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | $tableName = $platform->quoteIdentifier($tableName); |
110 | 110 | } |
111 | 111 | |
112 | - return $schema . $tableName; |
|
112 | + return $schema.$tableName; |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | /** |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | // Association defined as Id field |
130 | 130 | $joinColumns = $class->associationMappings[$fieldName]['joinColumns']; |
131 | 131 | $assocQuotedColumnNames = array_map( |
132 | - function ($joinColumn) use ($platform) |
|
132 | + function($joinColumn) use ($platform) |
|
133 | 133 | { |
134 | 134 | return isset($joinColumn['quoted']) |
135 | 135 | ? $platform->quoteIdentifier($joinColumn['name']) |
@@ -154,10 +154,10 @@ discard block |
||
154 | 154 | // If the alias is to long, characters are cut off from the beginning. |
155 | 155 | // 3 ) Strip non alphanumeric characters |
156 | 156 | // 4 ) Prefix with "_" if the result its numeric |
157 | - $columnName = $columnName . '_' . $counter; |
|
157 | + $columnName = $columnName.'_'.$counter; |
|
158 | 158 | $columnName = substr($columnName, -$platform->getMaxIdentifierLength()); |
159 | 159 | $columnName = preg_replace('/[^A-Za-z0-9_]/', '', $columnName); |
160 | - $columnName = is_numeric($columnName) ? '_' . $columnName : $columnName; |
|
160 | + $columnName = is_numeric($columnName) ? '_'.$columnName : $columnName; |
|
161 | 161 | |
162 | 162 | return $platform->getSQLResultCasing($columnName); |
163 | 163 | } |
@@ -20,7 +20,7 @@ |
||
20 | 20 | $this->_em->getClassMetadata(OwningSide::class), |
21 | 21 | $this->_em->getClassMetadata(InverseSide::class), |
22 | 22 | ]); |
23 | - } catch(ToolsException $e) { |
|
23 | + } catch (ToolsException $e) { |
|
24 | 24 | // ignored |
25 | 25 | } |
26 | 26 | } |
@@ -88,18 +88,18 @@ discard block |
||
88 | 88 | { |
89 | 89 | $q = $this->_em->createQuery("select a from Doctrine\Tests\Models\CMS\CmsArticle a"); |
90 | 90 | $q2 = $q->expireQueryCache(true) |
91 | - ->setQueryCacheLifetime(3600) |
|
92 | - ->setQueryCacheDriver(null) |
|
93 | - ->expireResultCache(true) |
|
94 | - ->setHint('foo', 'bar') |
|
95 | - ->setHint('bar', 'baz') |
|
96 | - ->setParameter(1, 'bar') |
|
97 | - ->setParameters(new ArrayCollection([new Parameter(2, 'baz')])) |
|
98 | - ->setResultCacheDriver(null) |
|
99 | - ->setResultCacheId('foo') |
|
100 | - ->setDQL('foo') |
|
101 | - ->setFirstResult(10) |
|
102 | - ->setMaxResults(10); |
|
91 | + ->setQueryCacheLifetime(3600) |
|
92 | + ->setQueryCacheDriver(null) |
|
93 | + ->expireResultCache(true) |
|
94 | + ->setHint('foo', 'bar') |
|
95 | + ->setHint('bar', 'baz') |
|
96 | + ->setParameter(1, 'bar') |
|
97 | + ->setParameters(new ArrayCollection([new Parameter(2, 'baz')])) |
|
98 | + ->setResultCacheDriver(null) |
|
99 | + ->setResultCacheId('foo') |
|
100 | + ->setDQL('foo') |
|
101 | + ->setFirstResult(10) |
|
102 | + ->setMaxResults(10); |
|
103 | 103 | |
104 | 104 | $this->assertSame($q2, $q); |
105 | 105 | } |
@@ -257,11 +257,11 @@ discard block |
||
257 | 257 | $this->_em->getConfiguration()->setResultCacheImpl(new ArrayCache()); |
258 | 258 | |
259 | 259 | $query = $this->_em->createQuery("SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u") |
260 | - ->enableResultCache(); |
|
260 | + ->enableResultCache(); |
|
261 | 261 | |
262 | 262 | /** @var DriverConnectionMock $driverConnectionMock */ |
263 | 263 | $driverConnectionMock = $this->_em->getConnection() |
264 | - ->getWrappedConnection(); |
|
264 | + ->getWrappedConnection(); |
|
265 | 265 | |
266 | 266 | $driverConnectionMock->setStatementMock(new StatementArrayMock([['id_0' => 1]])); |
267 | 267 |
@@ -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->enableResultCache(); |
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 |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | { |
37 | 37 | $query = $this->_em->createQuery( |
38 | 38 | 'SELECT CONCAT(e.type, MIN(e.version)) pair' |
39 | - . ' FROM ' . GH7286Entity::class . ' e' |
|
39 | + . ' FROM '.GH7286Entity::class.' e' |
|
40 | 40 | . ' WHERE e.type IS NOT NULL' |
41 | 41 | . ' GROUP BY e.type' |
42 | 42 | . ' ORDER BY e.type' |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | |
61 | 61 | $query = $this->_em->createQuery( |
62 | 62 | 'SELECT CC(e.type, MIN(e.version)) pair' |
63 | - . ' FROM ' . GH7286Entity::class . ' e' |
|
63 | + . ' FROM '.GH7286Entity::class.' e' |
|
64 | 64 | . ' WHERE e.type IS NOT NULL AND e.type != :type' |
65 | 65 | . ' GROUP BY e.type' |
66 | 66 | ); |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | { |
21 | 21 | protected function _loadDriver() |
22 | 22 | { |
23 | - return new XmlDriver(__DIR__ . DIRECTORY_SEPARATOR . 'xml'); |
|
23 | + return new XmlDriver(__DIR__.DIRECTORY_SEPARATOR.'xml'); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | public function testClassTableInheritanceDiscriminatorMap() |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | */ |
153 | 153 | public function testValidateXmlSchema($xmlMappingFile) |
154 | 154 | { |
155 | - $xsdSchemaFile = __DIR__ . '/../../../../../doctrine-mapping.xsd'; |
|
155 | + $xsdSchemaFile = __DIR__.'/../../../../../doctrine-mapping.xsd'; |
|
156 | 156 | $dom = new \DOMDocument(); |
157 | 157 | |
158 | 158 | $dom->load($xmlMappingFile); |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | |
163 | 163 | static public function dataValidSchema() |
164 | 164 | { |
165 | - $list = glob(__DIR__ . '/xml/*.xml'); |
|
165 | + $list = glob(__DIR__.'/xml/*.xml'); |
|
166 | 166 | $invalid = [ |
167 | 167 | 'Doctrine.Tests.Models.DDC889.DDC889Class.dcm' |
168 | 168 | ]; |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | return ! in_array(pathinfo($item, PATHINFO_FILENAME), $invalid); |
172 | 172 | }); |
173 | 173 | |
174 | - return array_map(function($item){ |
|
174 | + return array_map(function($item) { |
|
175 | 175 | return [$item]; |
176 | 176 | }, $list); |
177 | 177 | } |
@@ -41,9 +41,9 @@ discard block |
||
41 | 41 | */ |
42 | 42 | public function exportClassMetadata(ClassMetadataInfo $metadata) |
43 | 43 | { |
44 | - $xml = new SimpleXmlElement('<?xml version="1.0" encoding="utf-8"?><doctrine-mapping ' . |
|
45 | - 'xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" ' . |
|
46 | - 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ' . |
|
44 | + $xml = new SimpleXmlElement('<?xml version="1.0" encoding="utf-8"?><doctrine-mapping '. |
|
45 | + 'xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" '. |
|
46 | + 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" '. |
|
47 | 47 | 'xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd" />'); |
48 | 48 | |
49 | 49 | if ($metadata->isMappedSuperclass) { |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | |
99 | 99 | $trackingPolicy = $this->_getChangeTrackingPolicyString($metadata->changeTrackingPolicy); |
100 | 100 | |
101 | - if ( $trackingPolicy != 'DEFERRED_IMPLICIT') { |
|
101 | + if ($trackingPolicy != 'DEFERRED_IMPLICIT') { |
|
102 | 102 | $root->addChild('change-tracking-policy', $trackingPolicy); |
103 | 103 | } |
104 | 104 | |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | } |
298 | 298 | |
299 | 299 | if (count($cascade) === 5) { |
300 | - $cascade = ['cascade-all']; |
|
300 | + $cascade = ['cascade-all']; |
|
301 | 301 | } |
302 | 302 | |
303 | 303 | if ($cascade) { |
@@ -379,7 +379,7 @@ discard block |
||
379 | 379 | } |
380 | 380 | } |
381 | 381 | |
382 | - if (isset($metadata->lifecycleCallbacks) && count($metadata->lifecycleCallbacks)>0) { |
|
382 | + if (isset($metadata->lifecycleCallbacks) && count($metadata->lifecycleCallbacks) > 0) { |
|
383 | 383 | $lifecycleCallbacksXml = $root->addChild('lifecycle-callbacks'); |
384 | 384 | |
385 | 385 | foreach ($metadata->lifecycleCallbacks as $name => $methods) { |
@@ -430,7 +430,7 @@ discard block |
||
430 | 430 | { |
431 | 431 | $sequenceDefinition = $metadata->sequenceGeneratorDefinition; |
432 | 432 | |
433 | - if (! ($metadata->generatorType === ClassMetadataInfo::GENERATOR_TYPE_SEQUENCE && $sequenceDefinition)) { |
|
433 | + if ( ! ($metadata->generatorType === ClassMetadataInfo::GENERATOR_TYPE_SEQUENCE && $sequenceDefinition)) { |
|
434 | 434 | return; |
435 | 435 | } |
436 | 436 |
@@ -242,17 +242,17 @@ |
||
242 | 242 | public function getUnitOfWork(); |
243 | 243 | |
244 | 244 | /** |
245 | - * Gets a hydrator for the given hydration mode. |
|
246 | - * |
|
247 | - * This method caches the hydrator instances which is used for all queries that don't |
|
248 | - * selectively iterate over the result. |
|
249 | - * |
|
250 | - * @deprecated |
|
251 | - * |
|
252 | - * @param string|int $hydrationMode |
|
253 | - * |
|
254 | - * @return \Doctrine\ORM\Internal\Hydration\AbstractHydrator |
|
255 | - */ |
|
245 | + * Gets a hydrator for the given hydration mode. |
|
246 | + * |
|
247 | + * This method caches the hydrator instances which is used for all queries that don't |
|
248 | + * selectively iterate over the result. |
|
249 | + * |
|
250 | + * @deprecated |
|
251 | + * |
|
252 | + * @param string|int $hydrationMode |
|
253 | + * |
|
254 | + * @return \Doctrine\ORM\Internal\Hydration\AbstractHydrator |
|
255 | + */ |
|
256 | 256 | public function getHydrator($hydrationMode); |
257 | 257 | |
258 | 258 | /** |
@@ -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 |