@@ -14,11 +14,11 @@ discard block |
||
14 | 14 | { |
15 | 15 | protected function _loadDriver() |
16 | 16 | { |
17 | - if (!class_exists(Yaml::class, true)) { |
|
17 | + if ( ! class_exists(Yaml::class, true)) { |
|
18 | 18 | $this->markTestSkipped('Please install Symfony YAML Component into the include path of your PHP installation.'); |
19 | 19 | } |
20 | 20 | |
21 | - return new YamlDriver(__DIR__ . DIRECTORY_SEPARATOR . 'yaml'); |
|
21 | + return new YamlDriver(__DIR__.DIRECTORY_SEPARATOR.'yaml'); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | /** |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | public function testJoinTablesWithMappedSuperclassForYamlDriver() |
30 | 30 | { |
31 | 31 | $yamlDriver = $this->_loadDriver(); |
32 | - $yamlDriver->getLocator()->addPaths([__DIR__ . DIRECTORY_SEPARATOR . 'yaml']); |
|
32 | + $yamlDriver->getLocator()->addPaths([__DIR__.DIRECTORY_SEPARATOR.'yaml']); |
|
33 | 33 | |
34 | 34 | $em = $this->_getTestEntityManager(); |
35 | 35 | $em->getConfiguration()->setMetadataDriverImpl($yamlDriver); |
@@ -130,7 +130,7 @@ |
||
130 | 130 | { |
131 | 131 | $this->expectException(MappingException::class); |
132 | 132 | $this->expectExceptionMessage( |
133 | - 'Entity \'Doctrine\Tests\ORM\Mapping\HierarchyBEntity\' has to be part of the discriminator map' |
|
133 | + 'Entity \'Doctrine\Tests\ORM\Mapping\HierarchyBEntity\' has to be part of the discriminator map' |
|
134 | 134 | . ' of \'Doctrine\Tests\ORM\Mapping\HierarchyBase\' to be properly mapped in the inheritance hierarchy.' |
135 | 135 | . ' Alternatively you can make \'Doctrine\Tests\ORM\Mapping\HierarchyBEntity\' an abstract class to' |
136 | 136 | . ' avoid this exception from occurring.' |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | { |
19 | 19 | protected function _loadDriver() |
20 | 20 | { |
21 | - return new XmlDriver(__DIR__ . DIRECTORY_SEPARATOR . 'xml'); |
|
21 | + return new XmlDriver(__DIR__.DIRECTORY_SEPARATOR.'xml'); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | public function testClassTableInheritanceDiscriminatorMap() |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | */ |
151 | 151 | public function testValidateXmlSchema($xmlMappingFile) |
152 | 152 | { |
153 | - $xsdSchemaFile = __DIR__ . '/../../../../../doctrine-mapping.xsd'; |
|
153 | + $xsdSchemaFile = __DIR__.'/../../../../../doctrine-mapping.xsd'; |
|
154 | 154 | $dom = new \DOMDocument('UTF-8'); |
155 | 155 | |
156 | 156 | $dom->load($xmlMappingFile); |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | |
161 | 161 | static public function dataValidSchema() |
162 | 162 | { |
163 | - $list = glob(__DIR__ . '/xml/*.xml'); |
|
163 | + $list = glob(__DIR__.'/xml/*.xml'); |
|
164 | 164 | $invalid = [ |
165 | 165 | 'Doctrine.Tests.Models.DDC889.DDC889Class.dcm' |
166 | 166 | ]; |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | return ! in_array(pathinfo($item, PATHINFO_FILENAME), $invalid); |
170 | 170 | }); |
171 | 171 | |
172 | - return array_map(function($item){ |
|
172 | + return array_map(function($item) { |
|
173 | 173 | return [$item]; |
174 | 174 | }, $list); |
175 | 175 | } |
@@ -19,7 +19,7 @@ |
||
19 | 19 | protected function setUp() |
20 | 20 | { |
21 | 21 | parent::setUp(); |
22 | - $this->resolver = new DefaultEntityListenerResolver(); |
|
22 | + $this->resolver = new DefaultEntityListenerResolver(); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | public function testResolve() |
@@ -1078,7 +1078,7 @@ |
||
1078 | 1078 | $this->expectExceptionMessage("You have specified invalid cascade options for " . CMS\CmsUser::class . "::\$address: 'invalid'; available options: 'remove', 'persist', 'refresh', 'merge', and 'detach'"); |
1079 | 1079 | |
1080 | 1080 | $cm->mapManyToOne(['fieldName' => 'address', 'targetEntity' => 'UnknownClass', 'cascade' => ['invalid']]); |
1081 | - } |
|
1081 | + } |
|
1082 | 1082 | |
1083 | 1083 | /** |
1084 | 1084 | * @group DDC-964 |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | use Doctrine\Tests\OrmTestCase; |
22 | 22 | use DoctrineGlobal_Article; |
23 | 23 | |
24 | -require_once __DIR__ . '/../../Models/Global/GlobalNamespaceModel.php'; |
|
24 | +require_once __DIR__.'/../../Models/Global/GlobalNamespaceModel.php'; |
|
25 | 25 | |
26 | 26 | class ClassMetadataTest extends OrmTestCase |
27 | 27 | { |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | $this->assertEquals('phonenumbers', $oneOneMapping['fieldName']); |
72 | 72 | $this->assertEquals(CMS\CmsAddress::class, $oneOneMapping['targetEntity']); |
73 | 73 | $this->assertTrue($cm->isReadOnly); |
74 | - $this->assertEquals(['dql' => ['name'=>'dql','query'=>'foo','dql'=>'foo']], $cm->namedQueries); |
|
74 | + $this->assertEquals(['dql' => ['name'=>'dql', 'query'=>'foo', 'dql'=>'foo']], $cm->namedQueries); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | public function testFieldIsNullable() |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | { |
205 | 205 | $cm = new ClassMetadata(CMS\CmsUser::class); |
206 | 206 | $cm->initializeReflection(new RuntimeReflectionService()); |
207 | - $cm->isIdentifierComposite = true; |
|
207 | + $cm->isIdentifierComposite = true; |
|
208 | 208 | |
209 | 209 | $this->expectException(\Doctrine\ORM\Mapping\MappingException::class); |
210 | 210 | $cm->getSingleIdentifierFieldName(); |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | |
397 | 397 | $this->assertEquals('CMS_ADDRESS_CMS_USER', $manyToManyMetadata->associationMappings['user']['joinTable']['name']); |
398 | 398 | |
399 | - $this->assertEquals(['CMS_ADDRESS_ID','CMS_USER_ID'], $manyToManyMetadata->associationMappings['user']['joinTableColumns']); |
|
399 | + $this->assertEquals(['CMS_ADDRESS_ID', 'CMS_USER_ID'], $manyToManyMetadata->associationMappings['user']['joinTableColumns']); |
|
400 | 400 | $this->assertEquals(['CMS_ADDRESS_ID'=>'ID'], $manyToManyMetadata->associationMappings['user']['relationToSourceKeyColumns']); |
401 | 401 | $this->assertEquals(['CMS_USER_ID'=>'ID'], $manyToManyMetadata->associationMappings['user']['relationToTargetKeyColumns']); |
402 | 402 | |
@@ -436,7 +436,7 @@ discard block |
||
436 | 436 | $cm->initializeReflection(new RuntimeReflectionService()); |
437 | 437 | |
438 | 438 | $this->expectException(MappingException::class); |
439 | - $this->expectExceptionMessage("No mapping found for field 'foo' on class '" . CMS\CmsUser::class . "'."); |
|
439 | + $this->expectExceptionMessage("No mapping found for field 'foo' on class '".CMS\CmsUser::class."'."); |
|
440 | 440 | |
441 | 441 | $cm->getFieldMapping('foo'); |
442 | 442 | } |
@@ -546,7 +546,7 @@ discard block |
||
546 | 546 | public function testEmptyFieldNameThrowsException() |
547 | 547 | { |
548 | 548 | $this->expectException(MappingException::class); |
549 | - $this->expectExceptionMessage("The field or association mapping misses the 'fieldName' attribute in entity '" . CMS\CmsUser::class . "'."); |
|
549 | + $this->expectExceptionMessage("The field or association mapping misses the 'fieldName' attribute in entity '".CMS\CmsUser::class."'."); |
|
550 | 550 | |
551 | 551 | $cm = new ClassMetadata(CMS\CmsUser::class); |
552 | 552 | $cm->initializeReflection(new RuntimeReflectionService()); |
@@ -701,12 +701,12 @@ discard block |
||
701 | 701 | $mapping = $cm->getSqlResultSetMapping('find-all'); |
702 | 702 | |
703 | 703 | $this->assertEquals(CMS\CmsUser::class, $mapping['entities'][0]['entityClass']); |
704 | - $this->assertEquals(['name'=>'id','column'=>'id'], $mapping['entities'][0]['fields'][0]); |
|
705 | - $this->assertEquals(['name'=>'name','column'=>'name'], $mapping['entities'][0]['fields'][1]); |
|
704 | + $this->assertEquals(['name'=>'id', 'column'=>'id'], $mapping['entities'][0]['fields'][0]); |
|
705 | + $this->assertEquals(['name'=>'name', 'column'=>'name'], $mapping['entities'][0]['fields'][1]); |
|
706 | 706 | |
707 | 707 | $this->assertEquals(CMS\CmsEmail::class, $mapping['entities'][1]['entityClass']); |
708 | - $this->assertEquals(['name'=>'id','column'=>'id'], $mapping['entities'][1]['fields'][0]); |
|
709 | - $this->assertEquals(['name'=>'email','column'=>'email'], $mapping['entities'][1]['fields'][1]); |
|
708 | + $this->assertEquals(['name'=>'id', 'column'=>'id'], $mapping['entities'][1]['fields'][0]); |
|
709 | + $this->assertEquals(['name'=>'email', 'column'=>'email'], $mapping['entities'][1]['fields'][1]); |
|
710 | 710 | |
711 | 711 | $this->assertEquals('scalarColumn', $mapping['columns'][0]['name']); |
712 | 712 | } |
@@ -921,7 +921,7 @@ discard block |
||
921 | 921 | $cm->addLifecycleCallback('notfound', 'postLoad'); |
922 | 922 | |
923 | 923 | $this->expectException(MappingException::class); |
924 | - $this->expectExceptionMessage("Entity '" . CMS\CmsUser::class . "' has no method 'notfound' to be registered as lifecycle callback."); |
|
924 | + $this->expectExceptionMessage("Entity '".CMS\CmsUser::class."' has no method 'notfound' to be registered as lifecycle callback."); |
|
925 | 925 | |
926 | 926 | $cm->validateLifecycleCallbacks(new RuntimeReflectionService()); |
927 | 927 | } |
@@ -936,7 +936,7 @@ discard block |
||
936 | 936 | $cm->mapManyToOne(['fieldName' => 'address', 'targetEntity' => 'UnknownClass']); |
937 | 937 | |
938 | 938 | $this->expectException(MappingException::class); |
939 | - $this->expectExceptionMessage("The target-entity Doctrine\\Tests\\Models\\CMS\\UnknownClass cannot be found in '" . CMS\CmsUser::class . "#address'."); |
|
939 | + $this->expectExceptionMessage("The target-entity Doctrine\\Tests\\Models\\CMS\\UnknownClass cannot be found in '".CMS\CmsUser::class."#address'."); |
|
940 | 940 | |
941 | 941 | $cm->validateAssociations(); |
942 | 942 | } |
@@ -1075,7 +1075,7 @@ discard block |
||
1075 | 1075 | $cm->initializeReflection(new RuntimeReflectionService()); |
1076 | 1076 | |
1077 | 1077 | $this->expectException(MappingException::class); |
1078 | - $this->expectExceptionMessage("You have specified invalid cascade options for " . CMS\CmsUser::class . "::\$address: 'invalid'; available options: 'remove', 'persist', 'refresh', 'merge', and 'detach'"); |
|
1078 | + $this->expectExceptionMessage("You have specified invalid cascade options for ".CMS\CmsUser::class."::\$address: 'invalid'; available options: 'remove', 'persist', 'refresh', 'merge', and 'detach'"); |
|
1079 | 1079 | |
1080 | 1080 | $cm->mapManyToOne(['fieldName' => 'address', 'targetEntity' => 'UnknownClass', 'cascade' => ['invalid']]); |
1081 | 1081 | } |
@@ -1320,7 +1320,7 @@ discard block |
||
1320 | 1320 | */ |
1321 | 1321 | public function propertyToColumnName($propertyName, $className = null) |
1322 | 1322 | { |
1323 | - return strtolower($this->classToTableName($className)) . '_' . $propertyName; |
|
1323 | + return strtolower($this->classToTableName($className)).'_'.$propertyName; |
|
1324 | 1324 | } |
1325 | 1325 | } |
1326 | 1326 |
@@ -131,13 +131,13 @@ discard block |
||
131 | 131 | $cmf = new ClassMetadataFactory(); |
132 | 132 | $driver = $this->createMock(MappingDriver::class); |
133 | 133 | $driver->expects($this->at(0)) |
134 | - ->method('isTransient') |
|
135 | - ->with($this->equalTo(CmsUser::class)) |
|
136 | - ->will($this->returnValue(true)); |
|
134 | + ->method('isTransient') |
|
135 | + ->with($this->equalTo(CmsUser::class)) |
|
136 | + ->will($this->returnValue(true)); |
|
137 | 137 | $driver->expects($this->at(1)) |
138 | - ->method('isTransient') |
|
139 | - ->with($this->equalTo(CmsArticle::class)) |
|
140 | - ->will($this->returnValue(false)); |
|
138 | + ->method('isTransient') |
|
139 | + ->with($this->equalTo(CmsArticle::class)) |
|
140 | + ->will($this->returnValue(false)); |
|
141 | 141 | |
142 | 142 | $em = $this->_createEntityManager($driver); |
143 | 143 | |
@@ -153,13 +153,13 @@ discard block |
||
153 | 153 | $cmf = new ClassMetadataFactory(); |
154 | 154 | $driver = $this->createMock(MappingDriver::class); |
155 | 155 | $driver->expects($this->at(0)) |
156 | - ->method('isTransient') |
|
157 | - ->with($this->equalTo(CmsUser::class)) |
|
158 | - ->will($this->returnValue(true)); |
|
156 | + ->method('isTransient') |
|
157 | + ->with($this->equalTo(CmsUser::class)) |
|
158 | + ->will($this->returnValue(true)); |
|
159 | 159 | $driver->expects($this->at(1)) |
160 | - ->method('isTransient') |
|
161 | - ->with($this->equalTo(CmsArticle::class)) |
|
162 | - ->will($this->returnValue(false)); |
|
160 | + ->method('isTransient') |
|
161 | + ->with($this->equalTo(CmsArticle::class)) |
|
162 | + ->will($this->returnValue(false)); |
|
163 | 163 | |
164 | 164 | $em = $this->_createEntityManager($driver); |
165 | 165 | $em->getConfiguration()->addEntityNamespace('CMS', 'Doctrine\Tests\Models\CMS'); |
@@ -283,8 +283,8 @@ discard block |
||
283 | 283 | } |
284 | 284 | |
285 | 285 | /** |
286 | - * @group DDC-1845 |
|
287 | - */ |
|
286 | + * @group DDC-1845 |
|
287 | + */ |
|
288 | 288 | public function testQuoteMetadata() |
289 | 289 | { |
290 | 290 | $cmf = new ClassMetadataFactory(); |
@@ -108,15 +108,15 @@ discard block |
||
108 | 108 | { |
109 | 109 | require_once __DIR__."/../../Models/Global/GlobalNamespaceModel.php"; |
110 | 110 | |
111 | - $metadataDriver = $this->createAnnotationDriver([__DIR__ . '/../../Models/Global/']); |
|
111 | + $metadataDriver = $this->createAnnotationDriver([__DIR__.'/../../Models/Global/']); |
|
112 | 112 | |
113 | 113 | $entityManager = $this->_createEntityManager($metadataDriver); |
114 | 114 | |
115 | 115 | $mf = $entityManager->getMetadataFactory(); |
116 | 116 | $m1 = $mf->getMetadataFor(DoctrineGlobal_Article::class); |
117 | 117 | $h1 = $mf->hasMetadataFor(DoctrineGlobal_Article::class); |
118 | - $h2 = $mf->hasMetadataFor('\\' . DoctrineGlobal_Article::class); |
|
119 | - $m2 = $mf->getMetadataFor('\\' . DoctrineGlobal_Article::class); |
|
118 | + $h2 = $mf->hasMetadataFor('\\'.DoctrineGlobal_Article::class); |
|
119 | + $m2 = $mf->getMetadataFor('\\'.DoctrineGlobal_Article::class); |
|
120 | 120 | |
121 | 121 | $this->assertNotSame($m1, $m2); |
122 | 122 | $this->assertFalse($h2); |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | public function testAddDefaultDiscriminatorMap() |
172 | 172 | { |
173 | 173 | $cmf = new ClassMetadataFactory(); |
174 | - $driver = $this->createAnnotationDriver([__DIR__ . '/../../Models/JoinedInheritanceType/']); |
|
174 | + $driver = $this->createAnnotationDriver([__DIR__.'/../../Models/JoinedInheritanceType/']); |
|
175 | 175 | $em = $this->_createEntityManager($driver); |
176 | 176 | $cmf->setEntityManager($em); |
177 | 177 | |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | { |
212 | 212 | // DDC-3551 |
213 | 213 | $conn = $this->createMock(Connection::class); |
214 | - $mockDriver = new MetadataDriverMock(); |
|
214 | + $mockDriver = new MetadataDriverMock(); |
|
215 | 215 | $em = $this->_createEntityManager($mockDriver, $conn); |
216 | 216 | |
217 | 217 | $conn->expects($this->any()) |
@@ -231,10 +231,10 @@ discard block |
||
231 | 231 | { |
232 | 232 | $driverMock = new DriverMock(); |
233 | 233 | $config = new Configuration(); |
234 | - $config->setProxyDir(__DIR__ . '/../../Proxies'); |
|
234 | + $config->setProxyDir(__DIR__.'/../../Proxies'); |
|
235 | 235 | $config->setProxyNamespace('Doctrine\Tests\Proxies'); |
236 | 236 | $eventManager = new EventManager(); |
237 | - if (!$conn) { |
|
237 | + if ( ! $conn) { |
|
238 | 238 | $conn = new ConnectionMock([], $driverMock, $config, $eventManager); |
239 | 239 | } |
240 | 240 | $config->setMetadataDriverImpl($metadataDriver); |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | public function testQuoteMetadata() |
289 | 289 | { |
290 | 290 | $cmf = new ClassMetadataFactory(); |
291 | - $driver = $this->createAnnotationDriver([__DIR__ . '/../../Models/Quote/']); |
|
291 | + $driver = $this->createAnnotationDriver([__DIR__.'/../../Models/Quote/']); |
|
292 | 292 | $em = $this->_createEntityManager($driver); |
293 | 293 | $cmf->setEntityManager($em); |
294 | 294 | |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | $listener |
384 | 384 | ->expects($this->any()) |
385 | 385 | ->method('onClassMetadataNotFound') |
386 | - ->will($this->returnCallback(function (OnClassMetadataNotFoundEventArgs $args) use ($metadata, $em, $test) { |
|
386 | + ->will($this->returnCallback(function(OnClassMetadataNotFoundEventArgs $args) use ($metadata, $em, $test) { |
|
387 | 387 | $test->assertNull($args->getFoundMetadata()); |
388 | 388 | $test->assertSame('Foo', $args->getClassName()); |
389 | 389 | $test->assertSame($em, $args->getObjectManager()); |
@@ -443,7 +443,7 @@ discard block |
||
443 | 443 | public function testInheritsIdGeneratorMappingFromEmbeddable() |
444 | 444 | { |
445 | 445 | $cmf = new ClassMetadataFactory(); |
446 | - $driver = $this->createAnnotationDriver([__DIR__ . '/../../Models/DDC4006/']); |
|
446 | + $driver = $this->createAnnotationDriver([__DIR__.'/../../Models/DDC4006/']); |
|
447 | 447 | $em = $this->_createEntityManager($driver); |
448 | 448 | $cmf->setEntityManager($em); |
449 | 449 |
@@ -84,7 +84,7 @@ |
||
84 | 84 | $method = new \ReflectionMethod($this->_persister, 'getSelectConditionSQL'); |
85 | 85 | $method->setAccessible(true); |
86 | 86 | |
87 | - $sql = $method->invoke($this->_persister, ['customInteger' => 1, 'child' => 1]); |
|
87 | + $sql = $method->invoke($this->_persister, ['customInteger' => 1, 'child' => 1]); |
|
88 | 88 | |
89 | 89 | $this->assertEquals('t0.customInteger = ABS(?) AND t0.child_id = ?', $sql); |
90 | 90 | } |
@@ -272,12 +272,12 @@ discard block |
||
272 | 272 | { |
273 | 273 | $qb = $this->_em->createQueryBuilder(); |
274 | 274 | $qb->select('u') |
275 | - ->from(CmsUser::class, 'u') |
|
276 | - ->where('u.id = :uid') |
|
277 | - ->orWhere('u.id = :uid2') |
|
278 | - ->andWhere('u.id = :uid3') |
|
279 | - ->orWhere('u.name = :name1', 'u.name = :name2') |
|
280 | - ->andWhere('u.name <> :noname'); |
|
275 | + ->from(CmsUser::class, 'u') |
|
276 | + ->where('u.id = :uid') |
|
277 | + ->orWhere('u.id = :uid2') |
|
278 | + ->andWhere('u.id = :uid3') |
|
279 | + ->orWhere('u.name = :name1', 'u.name = :name2') |
|
280 | + ->andWhere('u.name <> :noname'); |
|
281 | 281 | |
282 | 282 | $this->assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE (((u.id = :uid OR u.id = :uid2) AND u.id = :uid3) OR u.name = :name1 OR u.name = :name2) AND u.name <> :noname'); |
283 | 283 | } |
@@ -286,9 +286,9 @@ discard block |
||
286 | 286 | { |
287 | 287 | $qb = $this->_em->createQueryBuilder(); |
288 | 288 | $qb->select('u') |
289 | - ->from(CmsUser::class, 'u') |
|
290 | - ->where('u.id = :uid') |
|
291 | - ->andWhere($qb->expr()->in('u.id', [1, 2, 3])); |
|
289 | + ->from(CmsUser::class, 'u') |
|
290 | + ->where('u.id = :uid') |
|
291 | + ->andWhere($qb->expr()->in('u.id', [1, 2, 3])); |
|
292 | 292 | |
293 | 293 | $this->assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = :uid AND u.id IN(1, 2, 3)'); |
294 | 294 | } |
@@ -297,9 +297,9 @@ discard block |
||
297 | 297 | { |
298 | 298 | $qb = $this->_em->createQueryBuilder(); |
299 | 299 | $qb->select('u') |
300 | - ->from(CmsUser::class, 'u') |
|
301 | - ->where('u.id = :uid') |
|
302 | - ->orWhere($qb->expr()->in('u.id', [1, 2, 3])); |
|
300 | + ->from(CmsUser::class, 'u') |
|
301 | + ->where('u.id = :uid') |
|
302 | + ->orWhere($qb->expr()->in('u.id', [1, 2, 3])); |
|
303 | 303 | |
304 | 304 | $this->assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = :uid OR u.id IN(1, 2, 3)'); |
305 | 305 | } |
@@ -308,9 +308,9 @@ discard block |
||
308 | 308 | { |
309 | 309 | $qb = $this->_em->createQueryBuilder(); |
310 | 310 | $qb->select('u') |
311 | - ->from(CmsUser::class, 'u') |
|
312 | - ->where('u.id = :uid') |
|
313 | - ->andWhere($qb->expr()->notIn('u.id', [1, 2, 3])); |
|
311 | + ->from(CmsUser::class, 'u') |
|
312 | + ->where('u.id = :uid') |
|
313 | + ->andWhere($qb->expr()->notIn('u.id', [1, 2, 3])); |
|
314 | 314 | |
315 | 315 | $this->assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = :uid AND u.id NOT IN(1, 2, 3)'); |
316 | 316 | } |
@@ -319,9 +319,9 @@ discard block |
||
319 | 319 | { |
320 | 320 | $qb = $this->_em->createQueryBuilder(); |
321 | 321 | $qb->select('u') |
322 | - ->from(CmsUser::class, 'u') |
|
323 | - ->where('u.id = :uid') |
|
324 | - ->orWhere($qb->expr()->notIn('u.id', [1, 2, 3])); |
|
322 | + ->from(CmsUser::class, 'u') |
|
323 | + ->where('u.id = :uid') |
|
324 | + ->orWhere($qb->expr()->notIn('u.id', [1, 2, 3])); |
|
325 | 325 | |
326 | 326 | $this->assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = :uid OR u.id NOT IN(1, 2, 3)'); |
327 | 327 | } |
@@ -617,8 +617,8 @@ discard block |
||
617 | 617 | { |
618 | 618 | $qb = $this->_em->createQueryBuilder(); |
619 | 619 | $qb->select('u') |
620 | - ->from(CmsUser::class, 'u') |
|
621 | - ->where($qb->expr()->orX('u.username = :username', 'u.username = :username2')); |
|
620 | + ->from(CmsUser::class, 'u') |
|
621 | + ->where($qb->expr()->orX('u.username = :username', 'u.username = :username2')); |
|
622 | 622 | |
623 | 623 | $parameters = new ArrayCollection(); |
624 | 624 | $parameters->add(new Parameter('username', 'jwage')); |
@@ -634,8 +634,8 @@ discard block |
||
634 | 634 | { |
635 | 635 | $qb = $this->_em->createQueryBuilder(); |
636 | 636 | $qb->select('u') |
637 | - ->from(CmsUser::class, 'u') |
|
638 | - ->where('u.id = :id'); |
|
637 | + ->from(CmsUser::class, 'u') |
|
638 | + ->where('u.id = :id'); |
|
639 | 639 | |
640 | 640 | $parameters = new ArrayCollection(); |
641 | 641 | $parameters->add(new Parameter('id', 1)); |
@@ -684,8 +684,8 @@ discard block |
||
684 | 684 | { |
685 | 685 | $qb = $this->_em->createQueryBuilder(); |
686 | 686 | $qb->select('u') |
687 | - ->from(CmsUser::class, 'u') |
|
688 | - ->orWhere('u.id = :uid', $qb->expr()->eq('u.id', ':uid2')); |
|
687 | + ->from(CmsUser::class, 'u') |
|
688 | + ->orWhere('u.id = :uid', $qb->expr()->eq('u.id', ':uid2')); |
|
689 | 689 | |
690 | 690 | $this->assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = :uid OR u.id = :uid2'); |
691 | 691 | } |
@@ -698,8 +698,8 @@ discard block |
||
698 | 698 | $orExpr->add($qb->expr()->in('u.id', [1])); |
699 | 699 | |
700 | 700 | $qb->select('u') |
701 | - ->from(CmsUser::class, 'u') |
|
702 | - ->where($orExpr); |
|
701 | + ->from(CmsUser::class, 'u') |
|
702 | + ->where($orExpr); |
|
703 | 703 | |
704 | 704 | $this->assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = :uid3 OR u.id IN(1)'); |
705 | 705 | } |
@@ -708,8 +708,8 @@ discard block |
||
708 | 708 | { |
709 | 709 | $qb = $this->_em->createQueryBuilder(); |
710 | 710 | $qb->select('u') |
711 | - ->from(CmsUser::class, 'u') |
|
712 | - ->where($qb->expr()->in('u.name', ['one', 'two', 'three'])); |
|
711 | + ->from(CmsUser::class, 'u') |
|
712 | + ->where($qb->expr()->in('u.name', ['one', 'two', 'three'])); |
|
713 | 713 | |
714 | 714 | $this->assertValidQueryBuilder($qb, "SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.name IN('one', 'two', 'three')"); |
715 | 715 | |
@@ -723,8 +723,8 @@ discard block |
||
723 | 723 | $qb = $this->_em->createQueryBuilder(); |
724 | 724 | $expr = $this->_em->getExpressionBuilder(); |
725 | 725 | $qb->select('u') |
726 | - ->from(CmsUser::class, 'u') |
|
727 | - ->where($expr->in('u.name', [$expr->literal('one'), $expr->literal('two'), $expr->literal('three')])); |
|
726 | + ->from(CmsUser::class, 'u') |
|
727 | + ->where($expr->in('u.name', [$expr->literal('one'), $expr->literal('two'), $expr->literal('three')])); |
|
728 | 728 | |
729 | 729 | $this->assertValidQueryBuilder($qb, "SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.name IN('one', 'two', 'three')"); |
730 | 730 | |
@@ -742,8 +742,8 @@ discard block |
||
742 | 742 | |
743 | 743 | $qb = $this->_em->createQueryBuilder(); |
744 | 744 | $qb->select('u') |
745 | - ->from(CmsUser::class, 'u') |
|
746 | - ->where($orExpr); |
|
745 | + ->from(CmsUser::class, 'u') |
|
746 | + ->where($orExpr); |
|
747 | 747 | |
748 | 748 | $this->assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = :uid3 OR NOT(u.id IN(1))'); |
749 | 749 | } |
@@ -754,8 +754,8 @@ discard block |
||
754 | 754 | $expr = $this->_em->getExpressionBuilder(); |
755 | 755 | |
756 | 756 | $qb->select('u') |
757 | - ->from(CmsUser::class, 'u') |
|
758 | - ->where($expr->gt('u.id', $expr->all('select a.id from Doctrine\Tests\Models\CMS\CmsArticle a'))); |
|
757 | + ->from(CmsUser::class, 'u') |
|
758 | + ->where($expr->gt('u.id', $expr->all('select a.id from Doctrine\Tests\Models\CMS\CmsArticle a'))); |
|
759 | 759 | |
760 | 760 | $this->assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id > ALL(select a.id from Doctrine\Tests\Models\CMS\CmsArticle a)'); |
761 | 761 | |
@@ -1121,9 +1121,9 @@ discard block |
||
1121 | 1121 | public function testRebuildsFromParts() |
1122 | 1122 | { |
1123 | 1123 | $qb = $this->_em->createQueryBuilder() |
1124 | - ->select('u') |
|
1125 | - ->from(CmsUser::class, 'u') |
|
1126 | - ->join('u.article', 'a'); |
|
1124 | + ->select('u') |
|
1125 | + ->from(CmsUser::class, 'u') |
|
1126 | + ->join('u.article', 'a'); |
|
1127 | 1127 | |
1128 | 1128 | $dqlParts = $qb->getDQLParts(); |
1129 | 1129 | $dql = $qb->getDQL(); |
@@ -547,7 +547,7 @@ discard block |
||
547 | 547 | $qb = $this->_em->createQueryBuilder(); |
548 | 548 | $qb->select('u') |
549 | 549 | ->from(CmsUser::class, 'u') |
550 | - ->join('u.article','a'); |
|
550 | + ->join('u.article', 'a'); |
|
551 | 551 | |
552 | 552 | $criteria = new Criteria(); |
553 | 553 | $criteria->orderBy(['a.field' => Criteria::DESC]); |
@@ -824,7 +824,7 @@ discard block |
||
824 | 824 | ->from(CmsUser::class, 'u') |
825 | 825 | ->where('u.username = ?1')->orderBy('u.username'); |
826 | 826 | |
827 | - $this->assertEquals('u.username = ?1', (string)$qb->getDQLPart('where')); |
|
827 | + $this->assertEquals('u.username = ?1', (string) $qb->getDQLPart('where')); |
|
828 | 828 | $this->assertEquals(1, count($qb->getDQLPart('orderBy'))); |
829 | 829 | |
830 | 830 | $qb->resetDQLPart('where')->resetDQLPart('orderBy'); |
@@ -888,7 +888,7 @@ discard block |
||
888 | 888 | { |
889 | 889 | $qb = $this->_em->createQueryBuilder(); |
890 | 890 | $qb->select('alias1')->from(CmsUser::class, 'alias1'); |
891 | - $qb->join('alias1.articles','alias2'); |
|
891 | + $qb->join('alias1.articles', 'alias2'); |
|
892 | 892 | |
893 | 893 | $criteria = new Criteria(); |
894 | 894 | $criteria->where($criteria->expr()->eq('field', 'value1')); |
@@ -908,7 +908,7 @@ discard block |
||
908 | 908 | { |
909 | 909 | $qb = $this->_em->createQueryBuilder(); |
910 | 910 | $qb->select('alias1')->from(CmsUser::class, 'alias1'); |
911 | - $qb->join('alias1.articles','alias2'); |
|
911 | + $qb->join('alias1.articles', 'alias2'); |
|
912 | 912 | |
913 | 913 | $criteria = new Criteria(); |
914 | 914 | $criteria->where($criteria->expr()->eq('alias1.field', 'value1')); |
@@ -928,7 +928,7 @@ discard block |
||
928 | 928 | { |
929 | 929 | $qb = $this->_em->createQueryBuilder(); |
930 | 930 | $qb->select('alias1')->from(CmsUser::class, 'alias1'); |
931 | - $qb->join('alias1.articles','alias2'); |
|
931 | + $qb->join('alias1.articles', 'alias2'); |
|
932 | 932 | |
933 | 933 | $criteria = new Criteria(); |
934 | 934 | $criteria->where($criteria->expr()->eq('alias1.field', 'value1')); |
@@ -1044,7 +1044,7 @@ discard block |
||
1044 | 1044 | { |
1045 | 1045 | $qb = $this->_em->createQueryBuilder() |
1046 | 1046 | ->add('select', 'u') |
1047 | - ->add('from', CmsUser::class . ' u'); |
|
1047 | + ->add('from', CmsUser::class.' u'); |
|
1048 | 1048 | |
1049 | 1049 | $this->assertEquals('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u', $qb->getDQL()); |
1050 | 1050 | } |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | $size = 500; |
131 | 131 | $startPersist = microtime(true); |
132 | 132 | |
133 | - echo PHP_EOL . $label; |
|
133 | + echo PHP_EOL.$label; |
|
134 | 134 | |
135 | 135 | for ($i = 0; $i < $size; $i++) { |
136 | 136 | $em->persist(new Country("Country $i")); |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | $startPersist = microtime(true); |
165 | 165 | $country = new Country("Country"); |
166 | 166 | |
167 | - echo PHP_EOL . $label; |
|
167 | + echo PHP_EOL.$label; |
|
168 | 168 | |
169 | 169 | $em->persist($country); |
170 | 170 | $em->flush(); |
@@ -194,9 +194,9 @@ discard block |
||
194 | 194 | $em->flush(); |
195 | 195 | $em->clear(); |
196 | 196 | |
197 | - printf("\n[%s] persist %s states and %s cities", number_format( microtime(true) - $startPersist, 6), count($states), count($cities)); |
|
197 | + printf("\n[%s] persist %s states and %s cities", number_format(microtime(true) - $startPersist, 6), count($states), count($cities)); |
|
198 | 198 | |
199 | - $startFind = microtime(true); |
|
199 | + $startFind = microtime(true); |
|
200 | 200 | |
201 | 201 | for ($i = 0; $i < $times; $i++) { |
202 | 202 | |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | $countries = []; |
222 | 222 | $startPersist = microtime(true); |
223 | 223 | |
224 | - echo PHP_EOL . $label; |
|
224 | + echo PHP_EOL.$label; |
|
225 | 225 | |
226 | 226 | for ($i = 0; $i < $size; $i++) { |
227 | 227 | $country = new Country("Country $i"); |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | |
237 | 237 | printf("\n[%s] persist %s countries", number_format(microtime(true) - $startPersist, 6), $size); |
238 | 238 | |
239 | - $startFind = microtime(true); |
|
239 | + $startFind = microtime(true); |
|
240 | 240 | |
241 | 241 | for ($i = 0; $i <= $times; $i++) { |
242 | 242 | foreach ($countries as $country) { |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | $startPersist = microtime(true); |
257 | 257 | $rep = $em->getRepository(Country::class); |
258 | 258 | |
259 | - echo PHP_EOL . $label; |
|
259 | + echo PHP_EOL.$label; |
|
260 | 260 | |
261 | 261 | for ($i = 0; $i < $size; $i++) { |
262 | 262 | $em->persist(new Country("Country $i")); |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | |
268 | 268 | printf("\n[%s] persist %s countries", number_format(microtime(true) - $startPersist, 6), $size); |
269 | 269 | |
270 | - $startFind = microtime(true); |
|
270 | + $startFind = microtime(true); |
|
271 | 271 | |
272 | 272 | for ($i = 0; $i <= $times; $i++) { |
273 | 273 | $list = $rep->findAll(); |