@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | $targetEntity = current( |
226 | 226 | array_filter( |
227 | 227 | $classes, |
228 | - function (ClassMetadata $class) use ($idMapping) : bool { |
|
228 | + function(ClassMetadata $class) use ($idMapping) : bool { |
|
229 | 229 | return $class->name === $idMapping['targetEntity']; |
230 | 230 | } |
231 | 231 | ) |
@@ -645,8 +645,8 @@ discard block |
||
645 | 645 | |
646 | 646 | if ( ! $definingClass) { |
647 | 647 | throw new \Doctrine\ORM\ORMException( |
648 | - 'Column name `' . $joinColumn['referencedColumnName'] . '` referenced for relation from ' |
|
649 | - . $mapping['sourceEntity'] . ' towards ' . $mapping['targetEntity'] . ' does not exist.' |
|
648 | + 'Column name `'.$joinColumn['referencedColumnName'].'` referenced for relation from ' |
|
649 | + . $mapping['sourceEntity'].' towards '.$mapping['targetEntity'].' does not exist.' |
|
650 | 650 | ); |
651 | 651 | } |
652 | 652 | |
@@ -710,7 +710,7 @@ discard block |
||
710 | 710 | |
711 | 711 | $compositeName = $theJoinTable->getName().'.'.implode('', $localColumns); |
712 | 712 | |
713 | - if (! $this->platform->supportsForeignKeyConstraints()) { |
|
713 | + if ( ! $this->platform->supportsForeignKeyConstraints()) { |
|
714 | 714 | return; |
715 | 715 | } |
716 | 716 | |
@@ -746,7 +746,7 @@ discard block |
||
746 | 746 | */ |
747 | 747 | private function gatherColumnOptions(array $mapping) : array |
748 | 748 | { |
749 | - if (! isset($mapping['options'])) { |
|
749 | + if ( ! isset($mapping['options'])) { |
|
750 | 750 | return []; |
751 | 751 | } |
752 | 752 | |
@@ -852,7 +852,7 @@ discard block |
||
852 | 852 | if ($table->hasPrimaryKey()) { |
853 | 853 | $columns = $table->getPrimaryKey()->getColumns(); |
854 | 854 | if (count($columns) == 1) { |
855 | - $checkSequence = $table->getName() . '_' . $columns[0] . '_seq'; |
|
855 | + $checkSequence = $table->getName().'_'.$columns[0].'_seq'; |
|
856 | 856 | if ($fullSchema->hasSequence($checkSequence)) { |
857 | 857 | $visitor->acceptSequence($fullSchema->getSequence($checkSequence)); |
858 | 858 | } |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | protected function setUp() { |
14 | 14 | parent::setUp(); |
15 | 15 | if ($this->_em->getConnection()->getDatabasePlatform()->getName() !== 'mysql') { |
16 | - $this->markTestSkipped('The ' . __CLASS__ .' requires the use of mysql.'); |
|
16 | + $this->markTestSkipped('The '.__CLASS__.' requires the use of mysql.'); |
|
17 | 17 | } |
18 | 18 | } |
19 | 19 | |
@@ -32,14 +32,14 @@ discard block |
||
32 | 32 | $sql = $tool->getCreateSchemaSql($classes); |
33 | 33 | $collation = $this->getColumnCollationDeclarationSQL('utf8_unicode_ci'); |
34 | 34 | |
35 | - $this->assertEquals('CREATE TABLE cms_groups (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(50) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 ' . $collation . ' ENGINE = InnoDB', $sql[0]); |
|
36 | - $this->assertEquals('CREATE TABLE cms_users (id INT AUTO_INCREMENT NOT NULL, email_id INT DEFAULT NULL, status VARCHAR(50) DEFAULT NULL, username VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_3AF03EC5F85E0677 (username), UNIQUE INDEX UNIQ_3AF03EC5A832C1C9 (email_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 ' . $collation . ' ENGINE = InnoDB', $sql[1]); |
|
37 | - $this->assertEquals('CREATE TABLE cms_users_groups (user_id INT NOT NULL, group_id INT NOT NULL, INDEX IDX_7EA9409AA76ED395 (user_id), INDEX IDX_7EA9409AFE54D947 (group_id), PRIMARY KEY(user_id, group_id)) DEFAULT CHARACTER SET utf8 ' . $collation . ' ENGINE = InnoDB', $sql[2]); |
|
38 | - $this->assertEquals('CREATE TABLE cms_users_tags (user_id INT NOT NULL, tag_id INT NOT NULL, INDEX IDX_93F5A1ADA76ED395 (user_id), INDEX IDX_93F5A1ADBAD26311 (tag_id), PRIMARY KEY(user_id, tag_id)) DEFAULT CHARACTER SET utf8 ' . $collation . ' ENGINE = InnoDB', $sql[3]); |
|
39 | - $this->assertEquals('CREATE TABLE cms_tags (id INT AUTO_INCREMENT NOT NULL, tag_name VARCHAR(50) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 ' . $collation . ' ENGINE = InnoDB', $sql[4]); |
|
40 | - $this->assertEquals('CREATE TABLE cms_addresses (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, country VARCHAR(50) NOT NULL, zip VARCHAR(50) NOT NULL, city VARCHAR(50) NOT NULL, UNIQUE INDEX UNIQ_ACAC157BA76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 ' . $collation . ' ENGINE = InnoDB', $sql[5]); |
|
41 | - $this->assertEquals('CREATE TABLE cms_emails (id INT AUTO_INCREMENT NOT NULL, email VARCHAR(250) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 ' . $collation . ' ENGINE = InnoDB', $sql[6]); |
|
42 | - $this->assertEquals('CREATE TABLE cms_phonenumbers (phonenumber VARCHAR(50) NOT NULL, user_id INT DEFAULT NULL, INDEX IDX_F21F790FA76ED395 (user_id), PRIMARY KEY(phonenumber)) DEFAULT CHARACTER SET utf8 ' . $collation . ' ENGINE = InnoDB', $sql[7]); |
|
35 | + $this->assertEquals('CREATE TABLE cms_groups (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(50) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 '.$collation.' ENGINE = InnoDB', $sql[0]); |
|
36 | + $this->assertEquals('CREATE TABLE cms_users (id INT AUTO_INCREMENT NOT NULL, email_id INT DEFAULT NULL, status VARCHAR(50) DEFAULT NULL, username VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_3AF03EC5F85E0677 (username), UNIQUE INDEX UNIQ_3AF03EC5A832C1C9 (email_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 '.$collation.' ENGINE = InnoDB', $sql[1]); |
|
37 | + $this->assertEquals('CREATE TABLE cms_users_groups (user_id INT NOT NULL, group_id INT NOT NULL, INDEX IDX_7EA9409AA76ED395 (user_id), INDEX IDX_7EA9409AFE54D947 (group_id), PRIMARY KEY(user_id, group_id)) DEFAULT CHARACTER SET utf8 '.$collation.' ENGINE = InnoDB', $sql[2]); |
|
38 | + $this->assertEquals('CREATE TABLE cms_users_tags (user_id INT NOT NULL, tag_id INT NOT NULL, INDEX IDX_93F5A1ADA76ED395 (user_id), INDEX IDX_93F5A1ADBAD26311 (tag_id), PRIMARY KEY(user_id, tag_id)) DEFAULT CHARACTER SET utf8 '.$collation.' ENGINE = InnoDB', $sql[3]); |
|
39 | + $this->assertEquals('CREATE TABLE cms_tags (id INT AUTO_INCREMENT NOT NULL, tag_name VARCHAR(50) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 '.$collation.' ENGINE = InnoDB', $sql[4]); |
|
40 | + $this->assertEquals('CREATE TABLE cms_addresses (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, country VARCHAR(50) NOT NULL, zip VARCHAR(50) NOT NULL, city VARCHAR(50) NOT NULL, UNIQUE INDEX UNIQ_ACAC157BA76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 '.$collation.' ENGINE = InnoDB', $sql[5]); |
|
41 | + $this->assertEquals('CREATE TABLE cms_emails (id INT AUTO_INCREMENT NOT NULL, email VARCHAR(250) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 '.$collation.' ENGINE = InnoDB', $sql[6]); |
|
42 | + $this->assertEquals('CREATE TABLE cms_phonenumbers (phonenumber VARCHAR(50) NOT NULL, user_id INT DEFAULT NULL, INDEX IDX_F21F790FA76ED395 (user_id), PRIMARY KEY(phonenumber)) DEFAULT CHARACTER SET utf8 '.$collation.' ENGINE = InnoDB', $sql[7]); |
|
43 | 43 | $this->assertEquals("ALTER TABLE cms_users ADD CONSTRAINT FK_3AF03EC5A832C1C9 FOREIGN KEY (email_id) REFERENCES cms_emails (id)", $sql[8]); |
44 | 44 | $this->assertEquals("ALTER TABLE cms_users_groups ADD CONSTRAINT FK_7EA9409AA76ED395 FOREIGN KEY (user_id) REFERENCES cms_users (id)", $sql[9]); |
45 | 45 | $this->assertEquals("ALTER TABLE cms_users_groups ADD CONSTRAINT FK_7EA9409AFE54D947 FOREIGN KEY (group_id) REFERENCES cms_groups (id)", $sql[10]); |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | $collation = $this->getColumnCollationDeclarationSQL('utf8_unicode_ci'); |
72 | 72 | |
73 | 73 | $this->assertEquals(1, count($sql)); |
74 | - $this->assertEquals('CREATE TABLE decimal_model (id INT AUTO_INCREMENT NOT NULL, `decimal` NUMERIC(5, 2) NOT NULL, `high_scale` NUMERIC(14, 4) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 ' . $collation . ' ENGINE = InnoDB', $sql[0]); |
|
74 | + $this->assertEquals('CREATE TABLE decimal_model (id INT AUTO_INCREMENT NOT NULL, `decimal` NUMERIC(5, 2) NOT NULL, `high_scale` NUMERIC(14, 4) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 '.$collation.' ENGINE = InnoDB', $sql[0]); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | public function testGetCreateSchemaSql3() |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | $collation = $this->getColumnCollationDeclarationSQL('utf8_unicode_ci'); |
86 | 86 | |
87 | 87 | $this->assertEquals(1, count($sql)); |
88 | - $this->assertEquals('CREATE TABLE boolean_model (id INT AUTO_INCREMENT NOT NULL, booleanField TINYINT(1) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 ' . $collation . ' ENGINE = InnoDB', $sql[0]); |
|
88 | + $this->assertEquals('CREATE TABLE boolean_model (id INT AUTO_INCREMENT NOT NULL, booleanField TINYINT(1) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 '.$collation.' ENGINE = InnoDB', $sql[0]); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | /** |
@@ -21,8 +21,8 @@ |
||
21 | 21 | ); |
22 | 22 | $collation = $this->getColumnCollationDeclarationSQL('utf8_unicode_ci'); |
23 | 23 | |
24 | - $this->assertEquals('CREATE TABLE DDC2182OptionParent (id INT UNSIGNED NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 ' . $collation . ' ENGINE = InnoDB', $sql[0]); |
|
25 | - $this->assertEquals('CREATE TABLE DDC2182OptionChild (id VARCHAR(255) NOT NULL, parent_id INT UNSIGNED DEFAULT NULL, INDEX IDX_B314D4AD727ACA70 (parent_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 ' . $collation . ' ENGINE = InnoDB', $sql[1]); |
|
24 | + $this->assertEquals('CREATE TABLE DDC2182OptionParent (id INT UNSIGNED NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 '.$collation.' ENGINE = InnoDB', $sql[0]); |
|
25 | + $this->assertEquals('CREATE TABLE DDC2182OptionChild (id VARCHAR(255) NOT NULL, parent_id INT UNSIGNED DEFAULT NULL, INDEX IDX_B314D4AD727ACA70 (parent_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 '.$collation.' ENGINE = InnoDB', $sql[1]); |
|
26 | 26 | $this->assertEquals("ALTER TABLE DDC2182OptionChild ADD CONSTRAINT FK_B314D4AD727ACA70 FOREIGN KEY (parent_id) REFERENCES DDC2182OptionParent (id)", $sql[2]); |
27 | 27 | } |
28 | 28 |
@@ -16,7 +16,7 @@ |
||
16 | 16 | { |
17 | 17 | public function testIssue() : void |
18 | 18 | { |
19 | - if (! $this->_em->getConnection()->getDatabasePlatform()->supportsForeignKeyConstraints()) { |
|
19 | + if ( ! $this->_em->getConnection()->getDatabasePlatform()->supportsForeignKeyConstraints()) { |
|
20 | 20 | $this->markTestSkipped('Platform does not support foreign keys.'); |
21 | 21 | } |
22 | 22 |
@@ -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 |
@@ -24,7 +24,7 @@ |
||
24 | 24 | $this->expectedDeprecations = []; |
25 | 25 | |
26 | 26 | $this->originalHandler = set_error_handler( |
27 | - function (int $errorNumber, string $errorMessage) : void { |
|
27 | + function(int $errorNumber, string $errorMessage) : void { |
|
28 | 28 | $this->actualDeprecations[] = $errorMessage; |
29 | 29 | }, |
30 | 30 | E_USER_DEPRECATED |
@@ -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); |