@@ -6,8 +6,8 @@ discard block |
||
6 | 6 | $metadata->setInheritanceType(ClassMetadataInfo::INHERITANCE_TYPE_NONE); |
7 | 7 | $metadata->setPrimaryTable( |
8 | 8 | [ |
9 | - 'name' => 'cms_users', |
|
10 | - 'options' => ['engine' => 'MyISAM', 'foo' => ['bar' => 'baz']], |
|
9 | + 'name' => 'cms_users', |
|
10 | + 'options' => ['engine' => 'MyISAM', 'foo' => ['bar' => 'baz']], |
|
11 | 11 | ] |
12 | 12 | ); |
13 | 13 | $metadata->setChangeTrackingPolicy(ClassMetadataInfo::CHANGETRACKING_DEFERRED_IMPLICIT); |
@@ -16,35 +16,35 @@ discard block |
||
16 | 16 | $metadata->addLifecycleCallback('doStuffOnPostPersist', 'postPersist'); |
17 | 17 | $metadata->mapField( |
18 | 18 | [ |
19 | - 'id' => true, |
|
20 | - 'fieldName' => 'id', |
|
21 | - 'type' => 'integer', |
|
22 | - 'columnName' => 'id', |
|
19 | + 'id' => true, |
|
20 | + 'fieldName' => 'id', |
|
21 | + 'type' => 'integer', |
|
22 | + 'columnName' => 'id', |
|
23 | 23 | ] |
24 | 24 | ); |
25 | 25 | $metadata->mapField( |
26 | 26 | [ |
27 | - 'fieldName' => 'name', |
|
28 | - 'type' => 'string', |
|
29 | - 'length' => 50, |
|
30 | - 'unique' => true, |
|
31 | - 'nullable' => true, |
|
32 | - 'columnName' => 'name', |
|
27 | + 'fieldName' => 'name', |
|
28 | + 'type' => 'string', |
|
29 | + 'length' => 50, |
|
30 | + 'unique' => true, |
|
31 | + 'nullable' => true, |
|
32 | + 'columnName' => 'name', |
|
33 | 33 | ] |
34 | 34 | ); |
35 | 35 | $metadata->mapField( |
36 | 36 | [ |
37 | - 'fieldName' => 'email', |
|
38 | - 'type' => 'string', |
|
39 | - 'columnName' => 'user_email', |
|
40 | - 'columnDefinition' => 'CHAR(32) NOT NULL', |
|
37 | + 'fieldName' => 'email', |
|
38 | + 'type' => 'string', |
|
39 | + 'columnName' => 'user_email', |
|
40 | + 'columnDefinition' => 'CHAR(32) NOT NULL', |
|
41 | 41 | ] |
42 | 42 | ); |
43 | 43 | $metadata->mapField( |
44 | 44 | [ |
45 | - 'fieldName' => 'age', |
|
46 | - 'type' => 'integer', |
|
47 | - 'options' => ["unsigned"=>true], |
|
45 | + 'fieldName' => 'age', |
|
46 | + 'type' => 'integer', |
|
47 | + 'options' => ["unsigned"=>true], |
|
48 | 48 | ] |
49 | 49 | ); |
50 | 50 | $metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_AUTO); |
@@ -56,25 +56,25 @@ discard block |
||
56 | 56 | ); |
57 | 57 | $metadata->mapOneToOne( |
58 | 58 | [ |
59 | - 'fieldName' => 'address', |
|
60 | - 'targetEntity' => Export\Address::class, |
|
61 | - 'inversedBy' => 'user', |
|
62 | - 'cascade' => |
|
63 | - [ |
|
64 | - 0 => 'persist', |
|
65 | - ], |
|
66 | - 'mappedBy' => NULL, |
|
67 | - 'joinColumns' => |
|
68 | - [ |
|
69 | - 0 => |
|
70 | - [ |
|
59 | + 'fieldName' => 'address', |
|
60 | + 'targetEntity' => Export\Address::class, |
|
61 | + 'inversedBy' => 'user', |
|
62 | + 'cascade' => |
|
63 | + [ |
|
64 | + 0 => 'persist', |
|
65 | + ], |
|
66 | + 'mappedBy' => NULL, |
|
67 | + 'joinColumns' => |
|
68 | + [ |
|
69 | + 0 => |
|
70 | + [ |
|
71 | 71 | 'name' => 'address_id', |
72 | 72 | 'referencedColumnName' => 'id', |
73 | 73 | 'onDelete' => 'CASCADE', |
74 | - ], |
|
75 | - ], |
|
76 | - 'orphanRemoval' => true, |
|
77 | - 'fetch' => ClassMetadataInfo::FETCH_EAGER, |
|
74 | + ], |
|
75 | + ], |
|
76 | + 'orphanRemoval' => true, |
|
77 | + 'fetch' => ClassMetadataInfo::FETCH_EAGER, |
|
78 | 78 | ] |
79 | 79 | ); |
80 | 80 | $metadata->mapOneToOne( |
@@ -93,41 +93,41 @@ discard block |
||
93 | 93 | ); |
94 | 94 | $metadata->mapOneToMany( |
95 | 95 | [ |
96 | - 'fieldName' => 'phonenumbers', |
|
97 | - 'targetEntity' => Export\Phonenumber::class, |
|
98 | - 'cascade' => |
|
99 | - [ |
|
100 | - 1 => 'persist', |
|
101 | - 2 => 'merge', |
|
102 | - ], |
|
103 | - 'mappedBy' => 'user', |
|
104 | - 'orphanRemoval' => true, |
|
105 | - 'fetch' => ClassMetadataInfo::FETCH_LAZY, |
|
106 | - 'orderBy' => |
|
107 | - [ |
|
108 | - 'number' => 'ASC', |
|
109 | - ], |
|
96 | + 'fieldName' => 'phonenumbers', |
|
97 | + 'targetEntity' => Export\Phonenumber::class, |
|
98 | + 'cascade' => |
|
99 | + [ |
|
100 | + 1 => 'persist', |
|
101 | + 2 => 'merge', |
|
102 | + ], |
|
103 | + 'mappedBy' => 'user', |
|
104 | + 'orphanRemoval' => true, |
|
105 | + 'fetch' => ClassMetadataInfo::FETCH_LAZY, |
|
106 | + 'orderBy' => |
|
107 | + [ |
|
108 | + 'number' => 'ASC', |
|
109 | + ], |
|
110 | 110 | ] |
111 | 111 | ); |
112 | 112 | $metadata->mapManyToMany( |
113 | 113 | [ |
114 | - 'fieldName' => 'groups', |
|
115 | - 'targetEntity' => Export\Group::class, |
|
116 | - 'fetch' => ClassMetadataInfo::FETCH_EXTRA_LAZY, |
|
117 | - 'cascade' => |
|
118 | - [ |
|
119 | - 0 => 'remove', |
|
120 | - 1 => 'persist', |
|
121 | - 2 => 'refresh', |
|
122 | - 3 => 'merge', |
|
123 | - 4 => 'detach', |
|
124 | - ], |
|
125 | - 'mappedBy' => NULL, |
|
126 | - 'joinTable' => |
|
127 | - [ |
|
128 | - 'name' => 'cms_users_groups', |
|
129 | - 'joinColumns' => |
|
130 | - [ |
|
114 | + 'fieldName' => 'groups', |
|
115 | + 'targetEntity' => Export\Group::class, |
|
116 | + 'fetch' => ClassMetadataInfo::FETCH_EXTRA_LAZY, |
|
117 | + 'cascade' => |
|
118 | + [ |
|
119 | + 0 => 'remove', |
|
120 | + 1 => 'persist', |
|
121 | + 2 => 'refresh', |
|
122 | + 3 => 'merge', |
|
123 | + 4 => 'detach', |
|
124 | + ], |
|
125 | + 'mappedBy' => NULL, |
|
126 | + 'joinTable' => |
|
127 | + [ |
|
128 | + 'name' => 'cms_users_groups', |
|
129 | + 'joinColumns' => |
|
130 | + [ |
|
131 | 131 | 0 => |
132 | 132 | [ |
133 | 133 | 'name' => 'user_id', |
@@ -135,17 +135,17 @@ discard block |
||
135 | 135 | 'unique' => false, |
136 | 136 | 'nullable' => false, |
137 | 137 | ], |
138 | - ], |
|
139 | - 'inverseJoinColumns' => |
|
140 | - [ |
|
138 | + ], |
|
139 | + 'inverseJoinColumns' => |
|
140 | + [ |
|
141 | 141 | 0 => |
142 | 142 | [ |
143 | 143 | 'name' => 'group_id', |
144 | 144 | 'referencedColumnName' => 'id', |
145 | 145 | 'columnDefinition' => 'INT NULL', |
146 | 146 | ], |
147 | - ], |
|
148 | - ], |
|
149 | - 'orderBy' => NULL, |
|
147 | + ], |
|
148 | + ], |
|
149 | + 'orderBy' => NULL, |
|
150 | 150 | ] |
151 | 151 | ); |
@@ -72,7 +72,7 @@ |
||
72 | 72 | /** |
73 | 73 | * Arbitrary Join |
74 | 74 | */ |
75 | - public function testLimitSubqueryWithArbitraryJoin() |
|
75 | + public function testLimitSubqueryWithArbitraryJoin() |
|
76 | 76 | { |
77 | 77 | $dql = 'SELECT p, c FROM Doctrine\Tests\ORM\Tools\Pagination\MyBlogPost p JOIN Doctrine\Tests\ORM\Tools\Pagination\Category c WITH p.category = c'; |
78 | 78 | $query = $this->entityManager->createQuery($dql); |
@@ -84,7 +84,7 @@ |
||
84 | 84 | $this->entityManager->getConnection()->setDatabasePlatform(new PostgreSqlPlatform); |
85 | 85 | |
86 | 86 | $query = $this->entityManager->createQuery( |
87 | - 'SELECT u, g, COUNT(g.id) AS hidden g_quantity FROM Doctrine\Tests\ORM\Tools\Pagination\User u JOIN u.groups g ORDER BY g_quantity, u.id DESC' |
|
87 | + 'SELECT u, g, COUNT(g.id) AS hidden g_quantity FROM Doctrine\Tests\ORM\Tools\Pagination\User u JOIN u.groups g ORDER BY g_quantity, u.id DESC' |
|
88 | 88 | ); |
89 | 89 | $limitQuery = clone $query; |
90 | 90 | $limitQuery->setHint(Query::HINT_CUSTOM_OUTPUT_WALKER, LimitSubqueryOutputWalker::class); |
@@ -127,7 +127,7 @@ |
||
127 | 127 | */ |
128 | 128 | public function testWhereInQueryWithArbitraryJoin_NoWhere() |
129 | 129 | { |
130 | - $whereInQuery = $this->entityManager->createQuery( |
|
130 | + $whereInQuery = $this->entityManager->createQuery( |
|
131 | 131 | 'SELECT p FROM Doctrine\Tests\ORM\Tools\Pagination\BlogPost p JOIN Doctrine\Tests\ORM\Tools\Pagination\Category c WITH p.category = c' |
132 | 132 | ); |
133 | 133 | $whereInQuery->setHint(Query::HINT_CUSTOM_TREE_WALKERS, [WhereInWalker::class]); |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | $result[] = $city; |
135 | 135 | |
136 | 136 | $cityClass->setFieldValue($city, 'id', $i); |
137 | - $stateClass->setFieldValue($state, 'id', $i*2); |
|
137 | + $stateClass->setFieldValue($state, 'id', $i * 2); |
|
138 | 138 | |
139 | 139 | $uow->registerManaged($state, ['id' => $state->getId()], ['name' => $city->getName()]); |
140 | 140 | $uow->registerManaged($city, ['id' => $city->getId()], ['name' => $city->getName(), 'state' => $state]); |
@@ -179,8 +179,8 @@ discard block |
||
179 | 179 | $result[] = $city; |
180 | 180 | |
181 | 181 | $cityClass->setFieldValue($city, 'id', $i); |
182 | - $stateClass->setFieldValue($state, 'id', $i*2); |
|
183 | - $countryClass->setFieldValue($country, 'id', $i*3); |
|
182 | + $stateClass->setFieldValue($state, 'id', $i * 2); |
|
183 | + $countryClass->setFieldValue($country, 'id', $i * 3); |
|
184 | 184 | |
185 | 185 | $uow->registerManaged($country, ['id' => $country->getId()], ['name' => $country->getName()]); |
186 | 186 | $uow->registerManaged($state, ['id' => $state->getId()], ['name' => $state->getName(), 'country' => $country] |
@@ -364,7 +364,7 @@ discard block |
||
364 | 364 | $uow->registerManaged($state, ['id' => $state->getId()], ['name' => $city->getName()]); |
365 | 365 | $uow->registerManaged($city, ['id' => $city->getId()], ['name' => $city->getName(), 'state' => $state]); |
366 | 366 | |
367 | - $this->region->addReturn('put', true); // put root entity |
|
367 | + $this->region->addReturn('put', true); // put root entity |
|
368 | 368 | $this->region->addReturn('put', false); // association fails |
369 | 369 | |
370 | 370 | $this->assertFalse($this->queryCache->put($key, $rsm, $result)); |
@@ -399,7 +399,7 @@ discard block |
||
399 | 399 | $uow->registerManaged($state, ['id' => $state->getId()], ['name' => $state->getName(), 'cities' => $state->getCities()] |
400 | 400 | ); |
401 | 401 | |
402 | - $this->region->addReturn('put', true); // put root entity |
|
402 | + $this->region->addReturn('put', true); // put root entity |
|
403 | 403 | $this->region->addReturn('put', false); // collection association fails |
404 | 404 | |
405 | 405 | $this->assertFalse($this->queryCache->put($key, $rsm, $result)); |
@@ -564,7 +564,7 @@ discard block |
||
564 | 564 | $attractions = $reflection->invoke($this->queryCache, $rsm, 'a', $bavaria); |
565 | 565 | |
566 | 566 | $this->assertCount(2, $cities); |
567 | - $this->assertCount(2, $attractions); |
|
567 | + $this->assertCount(2, $attractions); |
|
568 | 568 | |
569 | 569 | $this->assertInstanceOf(Collection::class, $cities); |
570 | 570 | $this->assertInstanceOf(Collection::class, $attractions[0]); |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | |
53 | 53 | protected function createRegion() |
54 | 54 | { |
55 | - $this->directory = sys_get_temp_dir() . '/doctrine_lock_'. uniqid(); |
|
55 | + $this->directory = sys_get_temp_dir().'/doctrine_lock_'.uniqid(); |
|
56 | 56 | |
57 | 57 | $region = new DefaultRegion('concurren_region_test', $this->cache); |
58 | 58 | |
@@ -100,10 +100,10 @@ discard block |
||
100 | 100 | |
101 | 101 | file_put_contents($file, 'foo'); |
102 | 102 | $this->assertFileExists($file); |
103 | - $this->assertEquals('foo' , file_get_contents($file)); |
|
103 | + $this->assertEquals('foo', file_get_contents($file)); |
|
104 | 104 | |
105 | 105 | $this->assertNull($this->region->lock($key)); |
106 | - $this->assertEquals('foo' , file_get_contents($file)); |
|
106 | + $this->assertEquals('foo', file_get_contents($file)); |
|
107 | 107 | $this->assertFileExists($file); |
108 | 108 | |
109 | 109 | // should be not available |
@@ -128,11 +128,11 @@ discard block |
||
128 | 128 | // change the lock |
129 | 129 | file_put_contents($file, 'foo'); |
130 | 130 | $this->assertFileExists($file); |
131 | - $this->assertEquals('foo' , file_get_contents($file)); |
|
131 | + $this->assertEquals('foo', file_get_contents($file)); |
|
132 | 132 | |
133 | 133 | //try to unlock |
134 | 134 | $this->assertFalse($this->region->unlock($key, $lock)); |
135 | - $this->assertEquals('foo' , file_get_contents($file)); |
|
135 | + $this->assertEquals('foo', file_get_contents($file)); |
|
136 | 136 | $this->assertFileExists($file); |
137 | 137 | |
138 | 138 | // should be not available |
@@ -153,14 +153,14 @@ discard block |
||
153 | 153 | // create lock |
154 | 154 | file_put_contents($file, 'foo'); |
155 | 155 | $this->assertFileExists($file); |
156 | - $this->assertEquals('foo' , file_get_contents($file)); |
|
156 | + $this->assertEquals('foo', file_get_contents($file)); |
|
157 | 157 | |
158 | 158 | $this->assertFalse($this->region->contains($key)); |
159 | 159 | $this->assertFalse($this->region->put($key, $entry)); |
160 | 160 | $this->assertFalse($this->region->contains($key)); |
161 | 161 | |
162 | 162 | $this->assertFileExists($file); |
163 | - $this->assertEquals('foo' , file_get_contents($file)); |
|
163 | + $this->assertEquals('foo', file_get_contents($file)); |
|
164 | 164 | } |
165 | 165 | |
166 | 166 | public function testLockedEvict() |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | $reflectionDirectory->setAccessible(true); |
256 | 256 | $reflectionDirectory->setValue($region, str_repeat('a', 10000)); |
257 | 257 | |
258 | - set_error_handler(function () {}, E_WARNING); |
|
258 | + set_error_handler(function() {}, E_WARNING); |
|
259 | 259 | $this->assertTrue($region->evictAll()); |
260 | 260 | restore_error_handler(); |
261 | 261 | } |
@@ -81,7 +81,7 @@ |
||
81 | 81 | $entity->setId(1); |
82 | 82 | $uow->registerManaged($entity, $key->identifier, $data); |
83 | 83 | |
84 | - $cache = $this->structure->buildCacheEntry($metadata, $key, $entity); |
|
84 | + $cache = $this->structure->buildCacheEntry($metadata, $key, $entity); |
|
85 | 85 | |
86 | 86 | $this->assertInstanceOf(CacheEntry::class, $cache); |
87 | 87 | $this->assertInstanceOf(EntityCacheEntry::class, $cache); |
@@ -68,8 +68,8 @@ discard block |
||
68 | 68 | $cm->mapField(['fieldName' => 'name', 'columnName' => '`name`']); |
69 | 69 | $cm->mapField(['fieldName' => 'id', 'columnName' => 'id']); |
70 | 70 | |
71 | - $this->assertEquals('id' ,$this->strategy->getColumnName('id', $cm, $this->platform)); |
|
72 | - $this->assertEquals('"name"' ,$this->strategy->getColumnName('name', $cm, $this->platform)); |
|
71 | + $this->assertEquals('id', $this->strategy->getColumnName('id', $cm, $this->platform)); |
|
72 | + $this->assertEquals('"name"', $this->strategy->getColumnName('name', $cm, $this->platform)); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | public function testGetTableName() |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | ); |
190 | 190 | |
191 | 191 | $joinColumn = $cm->associationMappings['article']['joinColumns'][0]; |
192 | - $this->assertEquals('"article"',$this->strategy->getJoinColumnName($joinColumn, $cm, $this->platform)); |
|
192 | + $this->assertEquals('"article"', $this->strategy->getJoinColumnName($joinColumn, $cm, $this->platform)); |
|
193 | 193 | } |
194 | 194 | |
195 | 195 | public function testReferencedJoinColumnName() |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | ); |
211 | 211 | |
212 | 212 | $joinColumn = $cm->associationMappings['article']['joinColumns'][0]; |
213 | - $this->assertEquals('"id"',$this->strategy->getReferencedJoinColumnName($joinColumn, $cm, $this->platform)); |
|
213 | + $this->assertEquals('"id"', $this->strategy->getReferencedJoinColumnName($joinColumn, $cm, $this->platform)); |
|
214 | 214 | } |
215 | 215 | } |
216 | 216 |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | protected function _loadDriverForCMSModels() |
116 | 116 | { |
117 | 117 | $annotationDriver = $this->_loadDriver(); |
118 | - $annotationDriver->addPaths([__DIR__ . '/../../Models/CMS/']); |
|
118 | + $annotationDriver->addPaths([__DIR__.'/../../Models/CMS/']); |
|
119 | 119 | return $annotationDriver; |
120 | 120 | } |
121 | 121 | |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | public function testJoinTablesWithMappedSuperclassForAnnotationDriver() |
138 | 138 | { |
139 | 139 | $annotationDriver = $this->_loadDriver(); |
140 | - $annotationDriver->addPaths([__DIR__ . '/../../Models/DirectoryTree/']); |
|
140 | + $annotationDriver->addPaths([__DIR__.'/../../Models/DirectoryTree/']); |
|
141 | 141 | |
142 | 142 | $em = $this->_getTestEntityManager(); |
143 | 143 | $em->getConfiguration()->setMetadataDriverImpl($annotationDriver); |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | |
166 | 166 | $this->expectException(MappingException::class); |
167 | 167 | $this->expectExceptionMessage( |
168 | - "It is illegal to put an inverse side one-to-many or many-to-many association on " . |
|
168 | + "It is illegal to put an inverse side one-to-many or many-to-many association on ". |
|
169 | 169 | "mapped superclass 'Doctrine\Tests\ORM\Mapping\InvalidMappedSuperClass#users'" |
170 | 170 | ); |
171 | 171 | |
@@ -186,8 +186,8 @@ discard block |
||
186 | 186 | |
187 | 187 | $this->expectException(MappingException::class); |
188 | 188 | $this->expectExceptionMessage( |
189 | - "It is not supported to define inheritance information on a mapped " . |
|
190 | - "superclass '" . MappedSuperClassInheritence::class . "'." |
|
189 | + "It is not supported to define inheritance information on a mapped ". |
|
190 | + "superclass '".MappedSuperClassInheritence::class."'." |
|
191 | 191 | ); |
192 | 192 | |
193 | 193 | $usingInvalidMsc = $factory->getMetadataFor(MappedSuperClassInheritence::class); |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | |
246 | 246 | public function testAttributeOverridesMappingWithTrait() |
247 | 247 | { |
248 | - $factory = $this->createClassMetadataFactory(); |
|
248 | + $factory = $this->createClassMetadataFactory(); |
|
249 | 249 | |
250 | 250 | $metadataWithoutOverride = $factory->getMetadataFor(DDC1872ExampleEntityWithoutOverride::class); |
251 | 251 | $metadataWithOverride = $factory->getMetadataFor(DDC1872ExampleEntityWithOverride::class); |