@@ -49,13 +49,13 @@ discard block |
||
49 | 49 | { |
50 | 50 | parent::setUp(); |
51 | 51 | |
52 | - if (! Type::hasType(GH7820LineTextType::class)) { |
|
52 | + if ( ! Type::hasType(GH7820LineTextType::class)) { |
|
53 | 53 | Type::addType(GH7820LineTextType::class, GH7820LineTextType::class); |
54 | 54 | } |
55 | 55 | |
56 | 56 | $this->setUpEntitySchema([GH7820Line::class]); |
57 | 57 | |
58 | - $this->_em->createQuery('DELETE FROM ' . GH7820Line::class . ' l') |
|
58 | + $this->_em->createQuery('DELETE FROM '.GH7820Line::class.' l') |
|
59 | 59 | ->execute(); |
60 | 60 | |
61 | 61 | foreach (self::SONG as $index => $line) { |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | |
74 | 74 | self::assertSame( |
75 | 75 | self::SONG, |
76 | - array_map(static function (GH7820Line $line) : string { |
|
76 | + array_map(static function(GH7820Line $line) : string { |
|
77 | 77 | return $line->toString(); |
78 | 78 | }, iterator_to_array(new Paginator($query))) |
79 | 79 | ); |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | |
96 | 96 | self::assertSame( |
97 | 97 | self::SONG, |
98 | - array_map(static function (GH7820Line $line) : string { |
|
98 | + array_map(static function(GH7820Line $line) : string { |
|
99 | 99 | return $line->toString(); |
100 | 100 | }, iterator_to_array(new Paginator($query))), |
101 | 101 | 'Expected to return expected data before query cache is populated with DQL -> SQL translation. Were SQL parameters translated?' |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | |
108 | 108 | self::assertSame( |
109 | 109 | self::SONG, |
110 | - array_map(static function (GH7820Line $line) : string { |
|
110 | + array_map(static function(GH7820Line $line) : string { |
|
111 | 111 | return $line->toString(); |
112 | 112 | }, iterator_to_array(new Paginator($query))), |
113 | 113 | 'Expected to return expected data even when DQL -> SQL translation is present in cache. Were SQL parameters translated again?' |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | |
166 | 166 | public function __toString() : string |
167 | 167 | { |
168 | - return 'Line: ' . $this->text; |
|
168 | + return 'Line: '.$this->text; |
|
169 | 169 | } |
170 | 170 | } |
171 | 171 | |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | { |
176 | 176 | $text = parent::convertToPHPValue($value, $platform); |
177 | 177 | |
178 | - if (! is_string($text)) { |
|
178 | + if ( ! is_string($text)) { |
|
179 | 179 | return $text; |
180 | 180 | } |
181 | 181 | |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | |
185 | 185 | public function convertToDatabaseValue($value, AbstractPlatform $platform) |
186 | 186 | { |
187 | - if (! $value instanceof GH7820LineText) { |
|
187 | + if ( ! $value instanceof GH7820LineText) { |
|
188 | 188 | return parent::convertToDatabaseValue($value, $platform); |
189 | 189 | } |
190 | 190 |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | { |
45 | 45 | $driverMock = new DriverMock(); |
46 | 46 | $config = new Configuration(); |
47 | - $config->setProxyDir(__DIR__ . '/../../Proxies'); |
|
47 | + $config->setProxyDir(__DIR__.'/../../Proxies'); |
|
48 | 48 | $config->setProxyNamespace('Doctrine\Tests\Proxies'); |
49 | 49 | $eventManager = new EventManager(); |
50 | 50 | $conn = new ConnectionMock([], $driverMock, $config, $eventManager); |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | 'yaml' => YamlDriver::class, |
63 | 63 | ]; |
64 | 64 | |
65 | - $this->assertArrayHasKey($type, $mappingDriver, "There is no metadata driver for the type '" . $type . "'."); |
|
65 | + $this->assertArrayHasKey($type, $mappingDriver, "There is no metadata driver for the type '".$type."'."); |
|
66 | 66 | |
67 | 67 | $class = $mappingDriver[$type]; |
68 | 68 | $driver = ($type === 'annotation') |
@@ -85,10 +85,10 @@ discard block |
||
85 | 85 | |
86 | 86 | public function testExportDirectoryAndFilesAreCreated() |
87 | 87 | { |
88 | - $this->_deleteDirectory(__DIR__ . '/export/'.$this->_getType()); |
|
88 | + $this->_deleteDirectory(__DIR__.'/export/'.$this->_getType()); |
|
89 | 89 | |
90 | 90 | $type = $this->_getType(); |
91 | - $metadataDriver = $this->_createMetadataDriver($type, __DIR__ . '/' . $type); |
|
91 | + $metadataDriver = $this->_createMetadataDriver($type, __DIR__.'/'.$type); |
|
92 | 92 | $em = $this->_createEntityManager($metadataDriver); |
93 | 93 | $cmf = $this->_createClassMetadataFactory($em, $type); |
94 | 94 | $metadata = $cmf->getAllMetadata(); |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | |
100 | 100 | $type = $this->_getType(); |
101 | 101 | $cme = new ClassMetadataExporter(); |
102 | - $exporter = $cme->getExporter($type, __DIR__ . '/export/' . $type); |
|
102 | + $exporter = $cme->getExporter($type, __DIR__.'/export/'.$type); |
|
103 | 103 | |
104 | 104 | if ($type === 'annotation') { |
105 | 105 | $entityGenerator = new EntityGenerator(); |
@@ -114,9 +114,9 @@ discard block |
||
114 | 114 | $exporter->export(); |
115 | 115 | |
116 | 116 | if ($type == 'annotation') { |
117 | - $this->assertTrue(file_exists(__DIR__ . '/export/' . $type . '/'.str_replace('\\', '/', ExportedUser::class).$this->_extension)); |
|
117 | + $this->assertTrue(file_exists(__DIR__.'/export/'.$type.'/'.str_replace('\\', '/', ExportedUser::class).$this->_extension)); |
|
118 | 118 | } else { |
119 | - $this->assertTrue(file_exists(__DIR__ . '/export/' . $type . '/Doctrine.Tests.ORM.Tools.Export.ExportedUser'.$this->_extension)); |
|
119 | + $this->assertTrue(file_exists(__DIR__.'/export/'.$type.'/Doctrine.Tests.ORM.Tools.Export.ExportedUser'.$this->_extension)); |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | $this->assertHasDeprecationMessages(); |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | { |
130 | 130 | $type = $this->_getType(); |
131 | 131 | |
132 | - $metadataDriver = $this->_createMetadataDriver($type, __DIR__ . '/export/' . $type); |
|
132 | + $metadataDriver = $this->_createMetadataDriver($type, __DIR__.'/export/'.$type); |
|
133 | 133 | $em = $this->_createEntityManager($metadataDriver); |
134 | 134 | $cmf = $this->_createClassMetadataFactory($em, $type); |
135 | 135 | $metadata = $cmf->getAllMetadata(); |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | $type = $this->_getType(); |
216 | 216 | |
217 | 217 | if ($type == 'xml') { |
218 | - $xml = simplexml_load_file(__DIR__ . '/export/'.$type.'/Doctrine.Tests.ORM.Tools.Export.ExportedUser.dcm.xml'); |
|
218 | + $xml = simplexml_load_file(__DIR__.'/export/'.$type.'/Doctrine.Tests.ORM.Tools.Export.ExportedUser.dcm.xml'); |
|
219 | 219 | |
220 | 220 | $xml->registerXPathNamespace("d", "http://doctrine-project.org/schemas/orm/doctrine-mapping"); |
221 | 221 | $nodes = $xml->xpath("/d:doctrine-mapping/d:entity/d:field[@name='name' and @type='string' and @nullable='true']"); |
@@ -359,7 +359,7 @@ discard block |
||
359 | 359 | $type = $this->_getType(); |
360 | 360 | |
361 | 361 | if ($type == 'xml') { |
362 | - $xml = simplexml_load_file(__DIR__ . '/export/'.$type.'/Doctrine.Tests.ORM.Tools.Export.ExportedUser.dcm.xml'); |
|
362 | + $xml = simplexml_load_file(__DIR__.'/export/'.$type.'/Doctrine.Tests.ORM.Tools.Export.ExportedUser.dcm.xml'); |
|
363 | 363 | |
364 | 364 | $xml->registerXPathNamespace("d", "http://doctrine-project.org/schemas/orm/doctrine-mapping"); |
365 | 365 | $nodes = $xml->xpath("/d:doctrine-mapping/d:entity/d:one-to-many[@field='interests']/d:cascade/d:*"); |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | $this->assertEquals('cascade-all', $nodes[0]->getName()); |
369 | 369 | } else if ($type == 'yaml') { |
370 | 370 | $yaml = new Parser(); |
371 | - $value = $yaml->parse(file_get_contents(__DIR__ . '/export/'.$type.'/Doctrine.Tests.ORM.Tools.Export.ExportedUser.dcm.yml')); |
|
371 | + $value = $yaml->parse(file_get_contents(__DIR__.'/export/'.$type.'/Doctrine.Tests.ORM.Tools.Export.ExportedUser.dcm.yml')); |
|
372 | 372 | |
373 | 373 | $this->assertTrue(isset($value[ExportedUser::class]['oneToMany']['interests']['cascade'])); |
374 | 374 | $this->assertEquals(1, count($value[ExportedUser::class]['oneToMany']['interests']['cascade'])); |
@@ -408,10 +408,10 @@ discard block |
||
408 | 408 | if (is_file($path)) { |
409 | 409 | return unlink($path); |
410 | 410 | } else if (is_dir($path)) { |
411 | - $files = glob(rtrim($path,'/').'/*'); |
|
411 | + $files = glob(rtrim($path, '/').'/*'); |
|
412 | 412 | |
413 | 413 | if (is_array($files)) { |
414 | - foreach ($files as $file){ |
|
414 | + foreach ($files as $file) { |
|
415 | 415 | $this->_deleteDirectory($file); |
416 | 416 | } |
417 | 417 | } |
@@ -27,30 +27,30 @@ discard block |
||
27 | 27 | |
28 | 28 | public function testFailingCase() |
29 | 29 | { |
30 | - $parent = new DDC1383Entity(); |
|
31 | - $child = new DDC1383Entity(); |
|
30 | + $parent = new DDC1383Entity(); |
|
31 | + $child = new DDC1383Entity(); |
|
32 | 32 | |
33 | - $child->setReference($parent); |
|
33 | + $child->setReference($parent); |
|
34 | 34 | |
35 | - $this->_em->persist($parent); |
|
36 | - $this->_em->persist($child); |
|
35 | + $this->_em->persist($parent); |
|
36 | + $this->_em->persist($child); |
|
37 | 37 | |
38 | - $id = $child->getId(); |
|
38 | + $id = $child->getId(); |
|
39 | 39 | |
40 | - $this->_em->flush(); |
|
41 | - $this->_em->clear(); |
|
40 | + $this->_em->flush(); |
|
41 | + $this->_em->clear(); |
|
42 | 42 | |
43 | - // Try merging the parent entity |
|
44 | - $child = $this->_em->merge($child); |
|
45 | - $parent = $child->getReference(); |
|
43 | + // Try merging the parent entity |
|
44 | + $child = $this->_em->merge($child); |
|
45 | + $parent = $child->getReference(); |
|
46 | 46 | |
47 | - // Parent is not instance of the abstract class |
|
48 | - self::assertTrue($parent instanceof DDC1383AbstractEntity, |
|
49 | - "Entity class is " . get_class($parent) . ', "DDC1383AbstractEntity" was expected'); |
|
47 | + // Parent is not instance of the abstract class |
|
48 | + self::assertTrue($parent instanceof DDC1383AbstractEntity, |
|
49 | + "Entity class is " . get_class($parent) . ', "DDC1383AbstractEntity" was expected'); |
|
50 | 50 | |
51 | - // Parent is NOT instance of entity |
|
52 | - self::assertTrue($parent instanceof DDC1383Entity, |
|
53 | - "Entity class is " . get_class($parent) . ', "DDC1383Entity" was expected'); |
|
51 | + // Parent is NOT instance of entity |
|
52 | + self::assertTrue($parent instanceof DDC1383Entity, |
|
53 | + "Entity class is " . get_class($parent) . ', "DDC1383Entity" was expected'); |
|
54 | 54 | $this->assertHasDeprecationMessages(); |
55 | 55 | } |
56 | 56 | } |
@@ -63,22 +63,22 @@ discard block |
||
63 | 63 | */ |
64 | 64 | abstract class DDC1383AbstractEntity |
65 | 65 | { |
66 | - /** |
|
67 | - * @Id |
|
68 | - * @Column(type="integer") |
|
69 | - * @GeneratedValue |
|
70 | - */ |
|
71 | - protected $id; |
|
72 | - |
|
73 | - public function getId() |
|
74 | - { |
|
75 | - return $this->id; |
|
76 | - } |
|
77 | - |
|
78 | - public function setId($id) |
|
79 | - { |
|
80 | - $this->id = $id; |
|
81 | - } |
|
66 | + /** |
|
67 | + * @Id |
|
68 | + * @Column(type="integer") |
|
69 | + * @GeneratedValue |
|
70 | + */ |
|
71 | + protected $id; |
|
72 | + |
|
73 | + public function getId() |
|
74 | + { |
|
75 | + return $this->id; |
|
76 | + } |
|
77 | + |
|
78 | + public function setId($id) |
|
79 | + { |
|
80 | + $this->id = $id; |
|
81 | + } |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | /** |
@@ -86,18 +86,18 @@ discard block |
||
86 | 86 | */ |
87 | 87 | class DDC1383Entity extends DDC1383AbstractEntity |
88 | 88 | { |
89 | - /** |
|
90 | - * @ManyToOne(targetEntity="DDC1383AbstractEntity") |
|
91 | - */ |
|
92 | - protected $reference; |
|
93 | - |
|
94 | - public function getReference() |
|
95 | - { |
|
96 | - return $this->reference; |
|
97 | - } |
|
98 | - |
|
99 | - public function setReference(DDC1383AbstractEntity $reference) |
|
100 | - { |
|
101 | - $this->reference = $reference; |
|
102 | - } |
|
89 | + /** |
|
90 | + * @ManyToOne(targetEntity="DDC1383AbstractEntity") |
|
91 | + */ |
|
92 | + protected $reference; |
|
93 | + |
|
94 | + public function getReference() |
|
95 | + { |
|
96 | + return $this->reference; |
|
97 | + } |
|
98 | + |
|
99 | + public function setReference(DDC1383AbstractEntity $reference) |
|
100 | + { |
|
101 | + $this->reference = $reference; |
|
102 | + } |
|
103 | 103 | } |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | $this->_em->getClassMetadata(DDC1383Entity::class), |
23 | 23 | ] |
24 | 24 | ); |
25 | - } catch(\Exception $ignored) {} |
|
25 | + } catch (\Exception $ignored) {} |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | public function testFailingCase() |
@@ -46,11 +46,11 @@ discard block |
||
46 | 46 | |
47 | 47 | // Parent is not instance of the abstract class |
48 | 48 | self::assertTrue($parent instanceof DDC1383AbstractEntity, |
49 | - "Entity class is " . get_class($parent) . ', "DDC1383AbstractEntity" was expected'); |
|
49 | + "Entity class is ".get_class($parent).', "DDC1383AbstractEntity" was expected'); |
|
50 | 50 | |
51 | 51 | // Parent is NOT instance of entity |
52 | 52 | self::assertTrue($parent instanceof DDC1383Entity, |
53 | - "Entity class is " . get_class($parent) . ', "DDC1383Entity" was expected'); |
|
53 | + "Entity class is ".get_class($parent).', "DDC1383Entity" was expected'); |
|
54 | 54 | $this->assertHasDeprecationMessages(); |
55 | 55 | } |
56 | 56 | } |
@@ -17,11 +17,11 @@ discard block |
||
17 | 17 | |
18 | 18 | protected function _loadDriver() |
19 | 19 | { |
20 | - if (!class_exists(Yaml::class, true)) { |
|
20 | + if ( ! class_exists(Yaml::class, true)) { |
|
21 | 21 | $this->markTestSkipped('Please install Symfony YAML Component into the include path of your PHP installation.'); |
22 | 22 | } |
23 | 23 | |
24 | - return new YamlDriver(__DIR__ . DIRECTORY_SEPARATOR . 'yaml'); |
|
24 | + return new YamlDriver(__DIR__.DIRECTORY_SEPARATOR.'yaml'); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | /** |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | public function testJoinTablesWithMappedSuperclassForYamlDriver() |
33 | 33 | { |
34 | 34 | $yamlDriver = $this->_loadDriver(); |
35 | - $yamlDriver->getLocator()->addPaths([__DIR__ . DIRECTORY_SEPARATOR . 'yaml']); |
|
35 | + $yamlDriver->getLocator()->addPaths([__DIR__.DIRECTORY_SEPARATOR.'yaml']); |
|
36 | 36 | |
37 | 37 | $em = $this->_getTestEntityManager(); |
38 | 38 | $em->getConfiguration()->setMetadataDriverImpl($yamlDriver); |
@@ -400,7 +400,7 @@ discard block |
||
400 | 400 | */ |
401 | 401 | public function containsKey($key) |
402 | 402 | { |
403 | - if (! $this->initialized && $this->association['fetch'] === ClassMetadata::FETCH_EXTRA_LAZY |
|
403 | + if ( ! $this->initialized && $this->association['fetch'] === ClassMetadata::FETCH_EXTRA_LAZY |
|
404 | 404 | && isset($this->association['indexBy'])) { |
405 | 405 | $persister = $this->em->getUnitOfWork()->getCollectionPersister($this->association); |
406 | 406 | |
@@ -433,7 +433,7 @@ discard block |
||
433 | 433 | && $this->association['fetch'] === ClassMetadata::FETCH_EXTRA_LAZY |
434 | 434 | && isset($this->association['indexBy']) |
435 | 435 | ) { |
436 | - if (!$this->typeClass->isIdentifierComposite && $this->typeClass->isIdentifier($this->association['indexBy'])) { |
|
436 | + if ( ! $this->typeClass->isIdentifierComposite && $this->typeClass->isIdentifier($this->association['indexBy'])) { |
|
437 | 437 | return $this->em->find($this->typeClass->name, $key); |
438 | 438 | } |
439 | 439 | |
@@ -448,7 +448,7 @@ discard block |
||
448 | 448 | */ |
449 | 449 | public function count() |
450 | 450 | { |
451 | - if (! $this->initialized && $this->association !== null && $this->association['fetch'] === ClassMetadata::FETCH_EXTRA_LAZY) { |
|
451 | + if ( ! $this->initialized && $this->association !== null && $this->association['fetch'] === ClassMetadata::FETCH_EXTRA_LAZY) { |
|
452 | 452 | $persister = $this->em->getUnitOfWork()->getCollectionPersister($this->association); |
453 | 453 | |
454 | 454 | return $persister->count($this) + ($this->isDirty ? $this->collection->count() : 0); |
@@ -381,7 +381,7 @@ discard block |
||
381 | 381 | try { |
382 | 382 | // Collection deletions (deletions of complete collections) |
383 | 383 | foreach ($this->collectionDeletions as $collectionToDelete) { |
384 | - if (! $collectionToDelete instanceof PersistentCollection) { |
|
384 | + if ( ! $collectionToDelete instanceof PersistentCollection) { |
|
385 | 385 | $this->getCollectionPersister($collectionToDelete->getMapping())->delete($collectionToDelete); |
386 | 386 | |
387 | 387 | continue; |
@@ -513,7 +513,7 @@ discard block |
||
513 | 513 | $state = $this->getEntityState($entity); |
514 | 514 | |
515 | 515 | if ($state !== self::STATE_MANAGED && $state !== self::STATE_REMOVED) { |
516 | - throw new \InvalidArgumentException("Entity has to be managed or scheduled for removal for single computation " . self::objToStr($entity)); |
|
516 | + throw new \InvalidArgumentException("Entity has to be managed or scheduled for removal for single computation ".self::objToStr($entity)); |
|
517 | 517 | } |
518 | 518 | |
519 | 519 | $class = $this->em->getClassMetadata(get_class($entity)); |
@@ -569,7 +569,7 @@ discard block |
||
569 | 569 | $oid = spl_object_hash($entity); |
570 | 570 | $data = []; |
571 | 571 | |
572 | - if (!isset($this->entityChangeSets[$oid])) { |
|
572 | + if ( ! isset($this->entityChangeSets[$oid])) { |
|
573 | 573 | return $data; |
574 | 574 | } |
575 | 575 | |
@@ -732,7 +732,7 @@ discard block |
||
732 | 732 | if ($owner === null) { // cloned |
733 | 733 | $actualValue->setOwner($entity, $assoc); |
734 | 734 | } else if ($owner !== $entity) { // no clone, we have to fix |
735 | - if (!$actualValue->isInitialized()) { |
|
735 | + if ( ! $actualValue->isInitialized()) { |
|
736 | 736 | $actualValue->initialize(); // we have to do this otherwise the cols share state |
737 | 737 | } |
738 | 738 | $newValue = clone $actualValue; |
@@ -878,7 +878,7 @@ discard block |
||
878 | 878 | $targetClass = $this->em->getClassMetadata($assoc['targetEntity']); |
879 | 879 | |
880 | 880 | foreach ($unwrappedValue as $key => $entry) { |
881 | - if (! ($entry instanceof $targetClass->name)) { |
|
881 | + if ( ! ($entry instanceof $targetClass->name)) { |
|
882 | 882 | throw ORMInvalidArgumentException::invalidAssociation($targetClass, $assoc, $entry); |
883 | 883 | } |
884 | 884 | |
@@ -956,7 +956,7 @@ discard block |
||
956 | 956 | |
957 | 957 | // Some identifiers may be foreign keys to new entities. |
958 | 958 | // In this case, we don't have the value yet and should treat it as if we have a post-insert generator |
959 | - if (! $this->hasMissingIdsWhichAreForeignKeys($class, $idValue)) { |
|
959 | + if ( ! $this->hasMissingIdsWhichAreForeignKeys($class, $idValue)) { |
|
960 | 960 | $this->entityIdentifiers[$oid] = $idValue; |
961 | 961 | } |
962 | 962 | } |
@@ -1105,7 +1105,7 @@ discard block |
||
1105 | 1105 | } |
1106 | 1106 | } else { |
1107 | 1107 | foreach ($insertionsForClass as $oid => $entity) { |
1108 | - if (! isset($this->entityIdentifiers[$oid])) { |
|
1108 | + if ( ! isset($this->entityIdentifiers[$oid])) { |
|
1109 | 1109 | //entity was not added to identity map because some identifiers are foreign keys to new entities. |
1110 | 1110 | //add it now |
1111 | 1111 | $this->addToEntityIdentifiersAndEntityMap($class, $oid, $entity); |
@@ -1270,7 +1270,7 @@ discard block |
||
1270 | 1270 | |
1271 | 1271 | $joinColumns = reset($assoc['joinColumns']); |
1272 | 1272 | |
1273 | - $calc->addDependency($targetClass->name, $class->name, (int)empty($joinColumns['nullable'])); |
|
1273 | + $calc->addDependency($targetClass->name, $class->name, (int) empty($joinColumns['nullable'])); |
|
1274 | 1274 | |
1275 | 1275 | // If the target class has mapped subclasses, these share the same dependency. |
1276 | 1276 | if ( ! $targetClass->subClasses) { |
@@ -1793,7 +1793,7 @@ discard block |
||
1793 | 1793 | throw ORMInvalidArgumentException::detachedEntityCannot($entity, "persisted"); |
1794 | 1794 | |
1795 | 1795 | default: |
1796 | - throw new UnexpectedValueException("Unexpected entity state: $entityState." . self::objToStr($entity)); |
|
1796 | + throw new UnexpectedValueException("Unexpected entity state: $entityState.".self::objToStr($entity)); |
|
1797 | 1797 | } |
1798 | 1798 | |
1799 | 1799 | $this->cascadePersist($entity, $visited); |
@@ -1863,7 +1863,7 @@ discard block |
||
1863 | 1863 | case self::STATE_DETACHED: |
1864 | 1864 | throw ORMInvalidArgumentException::detachedEntityCannot($entity, "removed"); |
1865 | 1865 | default: |
1866 | - throw new UnexpectedValueException("Unexpected entity state: $entityState." . self::objToStr($entity)); |
|
1866 | + throw new UnexpectedValueException("Unexpected entity state: $entityState.".self::objToStr($entity)); |
|
1867 | 1867 | } |
1868 | 1868 | |
1869 | 1869 | } |
@@ -2002,7 +2002,7 @@ discard block |
||
2002 | 2002 | */ |
2003 | 2003 | private function ensureVersionMatch(ClassMetadata $class, $entity, $managedCopy) |
2004 | 2004 | { |
2005 | - if (! ($class->isVersioned && $this->isLoaded($managedCopy) && $this->isLoaded($entity))) { |
|
2005 | + if ( ! ($class->isVersioned && $this->isLoaded($managedCopy) && $this->isLoaded($entity))) { |
|
2006 | 2006 | return; |
2007 | 2007 | } |
2008 | 2008 | |
@@ -2027,7 +2027,7 @@ discard block |
||
2027 | 2027 | */ |
2028 | 2028 | private function isLoaded($entity) |
2029 | 2029 | { |
2030 | - return !($entity instanceof Proxy) || $entity->__isInitialized(); |
|
2030 | + return ! ($entity instanceof Proxy) || $entity->__isInitialized(); |
|
2031 | 2031 | } |
2032 | 2032 | |
2033 | 2033 | /** |
@@ -2185,7 +2185,7 @@ discard block |
||
2185 | 2185 | |
2186 | 2186 | $associationMappings = array_filter( |
2187 | 2187 | $class->associationMappings, |
2188 | - function ($assoc) { return $assoc['isCascadeRefresh']; } |
|
2188 | + function($assoc) { return $assoc['isCascadeRefresh']; } |
|
2189 | 2189 | ); |
2190 | 2190 | |
2191 | 2191 | foreach ($associationMappings as $assoc) { |
@@ -2228,7 +2228,7 @@ discard block |
||
2228 | 2228 | |
2229 | 2229 | $associationMappings = array_filter( |
2230 | 2230 | $class->associationMappings, |
2231 | - function ($assoc) { return $assoc['isCascadeDetach']; } |
|
2231 | + function($assoc) { return $assoc['isCascadeDetach']; } |
|
2232 | 2232 | ); |
2233 | 2233 | |
2234 | 2234 | foreach ($associationMappings as $assoc) { |
@@ -2272,7 +2272,7 @@ discard block |
||
2272 | 2272 | |
2273 | 2273 | $associationMappings = array_filter( |
2274 | 2274 | $class->associationMappings, |
2275 | - function ($assoc) { return $assoc['isCascadeMerge']; } |
|
2275 | + function($assoc) { return $assoc['isCascadeMerge']; } |
|
2276 | 2276 | ); |
2277 | 2277 | |
2278 | 2278 | foreach ($associationMappings as $assoc) { |
@@ -2311,7 +2311,7 @@ discard block |
||
2311 | 2311 | |
2312 | 2312 | $associationMappings = array_filter( |
2313 | 2313 | $class->associationMappings, |
2314 | - function ($assoc) { return $assoc['isCascadePersist']; } |
|
2314 | + function($assoc) { return $assoc['isCascadePersist']; } |
|
2315 | 2315 | ); |
2316 | 2316 | |
2317 | 2317 | foreach ($associationMappings as $assoc) { |
@@ -2340,7 +2340,7 @@ discard block |
||
2340 | 2340 | break; |
2341 | 2341 | |
2342 | 2342 | case ($relatedEntities !== null): |
2343 | - if (! $relatedEntities instanceof $assoc['targetEntity']) { |
|
2343 | + if ( ! $relatedEntities instanceof $assoc['targetEntity']) { |
|
2344 | 2344 | throw ORMInvalidArgumentException::invalidAssociation( |
2345 | 2345 | $this->em->getClassMetadata($assoc['targetEntity']), |
2346 | 2346 | $assoc, |
@@ -2371,13 +2371,13 @@ discard block |
||
2371 | 2371 | |
2372 | 2372 | $associationMappings = array_filter( |
2373 | 2373 | $class->associationMappings, |
2374 | - function ($assoc) { return $assoc['isCascadeRemove']; } |
|
2374 | + function($assoc) { return $assoc['isCascadeRemove']; } |
|
2375 | 2375 | ); |
2376 | 2376 | |
2377 | 2377 | $entitiesToCascade = []; |
2378 | 2378 | |
2379 | 2379 | foreach ($associationMappings as $assoc) { |
2380 | - if ($entity instanceof Proxy && !$entity->__isInitialized__) { |
|
2380 | + if ($entity instanceof Proxy && ! $entity->__isInitialized__) { |
|
2381 | 2381 | $entity->__load(); |
2382 | 2382 | } |
2383 | 2383 | |
@@ -2441,7 +2441,7 @@ discard block |
||
2441 | 2441 | return; |
2442 | 2442 | } |
2443 | 2443 | |
2444 | - if ($entity instanceof Proxy && !$entity->__isInitialized__) { |
|
2444 | + if ($entity instanceof Proxy && ! $entity->__isInitialized__) { |
|
2445 | 2445 | $entity->__load(); |
2446 | 2446 | } |
2447 | 2447 | |
@@ -2456,7 +2456,7 @@ discard block |
||
2456 | 2456 | case LockMode::NONE === $lockMode: |
2457 | 2457 | case LockMode::PESSIMISTIC_READ === $lockMode: |
2458 | 2458 | case LockMode::PESSIMISTIC_WRITE === $lockMode: |
2459 | - if (!$this->em->getConnection()->isTransactionActive()) { |
|
2459 | + if ( ! $this->em->getConnection()->isTransactionActive()) { |
|
2460 | 2460 | throw TransactionRequiredException::transactionRequired(); |
2461 | 2461 | } |
2462 | 2462 | |
@@ -2781,7 +2781,7 @@ discard block |
||
2781 | 2781 | // then we can append this entity for eager loading! |
2782 | 2782 | if ($hints['fetchMode'][$class->name][$field] == ClassMetadata::FETCH_EAGER && |
2783 | 2783 | isset($hints[self::HINT_DEFEREAGERLOAD]) && |
2784 | - !$targetClass->isIdentifierComposite && |
|
2784 | + ! $targetClass->isIdentifierComposite && |
|
2785 | 2785 | $newValue instanceof Proxy && |
2786 | 2786 | $newValue->__isInitialized__ === false) { |
2787 | 2787 | |
@@ -3146,7 +3146,7 @@ discard block |
||
3146 | 3146 | public function getCollectionPersister(array $association) |
3147 | 3147 | { |
3148 | 3148 | $role = isset($association['cache']) |
3149 | - ? $association['sourceEntity'] . '::' . $association['fieldName'] |
|
3149 | + ? $association['sourceEntity'].'::'.$association['fieldName'] |
|
3150 | 3150 | : $association['type']; |
3151 | 3151 | |
3152 | 3152 | if (isset($this->collectionPersisters[$role])) { |
@@ -3364,7 +3364,7 @@ discard block |
||
3364 | 3364 | */ |
3365 | 3365 | private function afterTransactionComplete() |
3366 | 3366 | { |
3367 | - $this->performCallbackOnCachedPersister(function (CachedPersister $persister) { |
|
3367 | + $this->performCallbackOnCachedPersister(function(CachedPersister $persister) { |
|
3368 | 3368 | $persister->afterTransactionComplete(); |
3369 | 3369 | }); |
3370 | 3370 | } |
@@ -3374,7 +3374,7 @@ discard block |
||
3374 | 3374 | */ |
3375 | 3375 | private function afterTransactionRolledBack() |
3376 | 3376 | { |
3377 | - $this->performCallbackOnCachedPersister(function (CachedPersister $persister) { |
|
3377 | + $this->performCallbackOnCachedPersister(function(CachedPersister $persister) { |
|
3378 | 3378 | $persister->afterTransactionRolledBack(); |
3379 | 3379 | }); |
3380 | 3380 | } |
@@ -3470,11 +3470,11 @@ discard block |
||
3470 | 3470 | */ |
3471 | 3471 | private function mergeEntityStateIntoManagedCopy($entity, $managedCopy) |
3472 | 3472 | { |
3473 | - if (! $this->isLoaded($entity)) { |
|
3473 | + if ( ! $this->isLoaded($entity)) { |
|
3474 | 3474 | return; |
3475 | 3475 | } |
3476 | 3476 | |
3477 | - if (! $this->isLoaded($managedCopy)) { |
|
3477 | + if ( ! $this->isLoaded($managedCopy)) { |
|
3478 | 3478 | $managedCopy->__load(); |
3479 | 3479 | } |
3480 | 3480 | |
@@ -3497,7 +3497,7 @@ discard block |
||
3497 | 3497 | if ($other === null) { |
3498 | 3498 | $prop->setValue($managedCopy, null); |
3499 | 3499 | } else { |
3500 | - if ($other instanceof Proxy && !$other->__isInitialized()) { |
|
3500 | + if ($other instanceof Proxy && ! $other->__isInitialized()) { |
|
3501 | 3501 | // do not merge fields marked lazy that have not been fetched. |
3502 | 3502 | continue; |
3503 | 3503 | } |
@@ -3584,7 +3584,7 @@ discard block |
||
3584 | 3584 | */ |
3585 | 3585 | private function clearIdentityMapForEntityName($entityName) |
3586 | 3586 | { |
3587 | - if (! isset($this->identityMap[$entityName])) { |
|
3587 | + if ( ! isset($this->identityMap[$entityName])) { |
|
3588 | 3588 | return; |
3589 | 3589 | } |
3590 | 3590 |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | : $value; |
318 | 318 | |
319 | 319 | if ($cacheKeyInfo['isIdentifier'] && $value !== null) { |
320 | - $id[$dqlAlias] .= '|' . $value; |
|
320 | + $id[$dqlAlias] .= '|'.$value; |
|
321 | 321 | $nonemptyComponents[$dqlAlias] = true; |
322 | 322 | } |
323 | 323 | break; |
@@ -352,11 +352,11 @@ discard block |
||
352 | 352 | |
353 | 353 | // WARNING: BC break! We know this is the desired behavior to type convert values, but this |
354 | 354 | // erroneous behavior exists since 2.0 and we're forced to keep compatibility. |
355 | - if (! isset($cacheKeyInfo['isScalar'])) { |
|
355 | + if ( ! isset($cacheKeyInfo['isScalar'])) { |
|
356 | 356 | $type = $cacheKeyInfo['type']; |
357 | 357 | $value = $type ? $type->convertToPHPValue($value, $this->_platform) : $value; |
358 | 358 | |
359 | - $fieldName = $cacheKeyInfo['dqlAlias'] . '_' . $fieldName; |
|
359 | + $fieldName = $cacheKeyInfo['dqlAlias'].'_'.$fieldName; |
|
360 | 360 | } |
361 | 361 | |
362 | 362 | $rowData[$fieldName] = $value; |
@@ -465,7 +465,7 @@ discard block |
||
465 | 465 | private function getDiscriminatorValues(ClassMetadata $classMetadata) : array |
466 | 466 | { |
467 | 467 | $values = array_map( |
468 | - function (string $subClass) : string { |
|
468 | + function(string $subClass) : string { |
|
469 | 469 | return (string) $this->getClassMetadata($subClass)->discriminatorValue; |
470 | 470 | }, |
471 | 471 | $classMetadata->subClasses |
@@ -69,11 +69,11 @@ |
||
69 | 69 | private function getTableFullName(array $table) : string |
70 | 70 | { |
71 | 71 | $join = '.'; |
72 | - if (! $this->platform->supportsSchemas() && $this->platform->canEmulateSchemas()) { |
|
72 | + if ( ! $this->platform->supportsSchemas() && $this->platform->canEmulateSchemas()) { |
|
73 | 73 | $join = '__'; |
74 | 74 | } |
75 | 75 | |
76 | - return $table['schema'] . $join . $table['name']; |
|
76 | + return $table['schema'].$join.$table['name']; |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | private function createClassMetadata(string $className) : ClassMetadata |
@@ -46,7 +46,7 @@ |
||
46 | 46 | |
47 | 47 | public function __construct() |
48 | 48 | { |
49 | - @trigger_error(self::class . ' is deprecated and will be removed in Doctrine ORM 3.0', E_USER_DEPRECATED); |
|
49 | + @trigger_error(self::class.' is deprecated and will be removed in Doctrine ORM 3.0', E_USER_DEPRECATED); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | /** |