@@ -93,7 +93,7 @@ |
||
93 | 93 | foreach ($this->drivers as $namespace => $driver) { |
94 | 94 | $oid = spl_object_hash($driver); |
95 | 95 | |
96 | - if (! isset($driverClasses[$oid])) { |
|
96 | + if (!isset($driverClasses[$oid])) { |
|
97 | 97 | $driverClasses[$oid] = $driver->getAllClassNames(); |
98 | 98 | } |
99 | 99 |
@@ -22,7 +22,7 @@ |
||
22 | 22 | */ |
23 | 23 | public function getParentClasses(string $class) : array |
24 | 24 | { |
25 | - if (! class_exists($class)) { |
|
25 | + if (!class_exists($class)) { |
|
26 | 26 | throw MappingException::nonExistingClass($class); |
27 | 27 | } |
28 | 28 |
@@ -89,7 +89,7 @@ |
||
89 | 89 | */ |
90 | 90 | private function assertValidField(string $field) : void |
91 | 91 | { |
92 | - if (! isset($this->entityChangeSet[$field])) { |
|
92 | + if (!isset($this->entityChangeSet[$field])) { |
|
93 | 93 | throw new InvalidArgumentException(sprintf( |
94 | 94 | 'Field "%s" is not a valid field of the entity "%s" in PreUpdateEventArgs.', |
95 | 95 | $field, |
@@ -38,13 +38,13 @@ |
||
38 | 38 | public function testGetParentClasses() : void |
39 | 39 | { |
40 | 40 | $classes = $this->reflectionService->getParentClasses(self::class); |
41 | - self::assertTrue(count($classes) >= 1, 'The test class ' . self::class . ' should have at least one parent.'); |
|
41 | + self::assertTrue(count($classes) >= 1, 'The test class '.self::class.' should have at least one parent.'); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | public function testGetParentClassesForAbsentClass() : void |
45 | 45 | { |
46 | 46 | $this->expectException(MappingException::class); |
47 | - $this->reflectionService->getParentClasses(__NAMESPACE__ . '\AbsentClass'); |
|
47 | + $this->reflectionService->getParentClasses(__NAMESPACE__.'\AbsentClass'); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | public function testGetReflectionClass() : void |
@@ -34,7 +34,7 @@ |
||
34 | 34 | public function testGetParentClasses() : void |
35 | 35 | { |
36 | 36 | $classes = $this->reflectionService->getParentClasses(self::class); |
37 | - self::assertTrue(count($classes) === 0, 'The test class ' . self::class . ' should have no parents according to static reflection.'); |
|
37 | + self::assertTrue(count($classes) === 0, 'The test class '.self::class.' should have no parents according to static reflection.'); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | public function testGetReflectionClass() : void |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | public function testGetMetadataForAbsentClass() : void |
52 | 52 | { |
53 | 53 | $this->expectException(MappingException::class); |
54 | - $this->cmf->getMetadataFor(__NAMESPACE__ . '\AbsentClass'); |
|
54 | + $this->cmf->getMetadataFor(__NAMESPACE__.'\AbsentClass'); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | public function testGetParentMetadata() : void |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | { |
68 | 68 | $metadata = $this->createMock(ClassMetadata::class); |
69 | 69 | $cache = new ArrayCache(); |
70 | - $cache->save(ChildEntity::class . '$CLASSMETADATA', $metadata); |
|
70 | + $cache->save(ChildEntity::class.'$CLASSMETADATA', $metadata); |
|
71 | 71 | |
72 | 72 | $this->cmf->setCacheDriver($cache); |
73 | 73 | |
@@ -81,14 +81,14 @@ discard block |
||
81 | 81 | |
82 | 82 | $loadedMetadata = $this->cmf->getMetadataFor(ChildEntity::class); |
83 | 83 | |
84 | - self::assertSame($loadedMetadata, $cache->fetch(ChildEntity::class . '$CLASSMETADATA')); |
|
84 | + self::assertSame($loadedMetadata, $cache->fetch(ChildEntity::class.'$CLASSMETADATA')); |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | public function testGetAliasedMetadata() : void |
88 | 88 | { |
89 | 89 | $this->cmf->getMetadataFor('prefix:ChildEntity'); |
90 | 90 | |
91 | - self::assertTrue($this->cmf->hasMetadataFor(__NAMESPACE__ . '\ChildEntity')); |
|
91 | + self::assertTrue($this->cmf->hasMetadataFor(__NAMESPACE__.'\ChildEntity')); |
|
92 | 92 | self::assertTrue($this->cmf->hasMetadataFor('prefix:ChildEntity')); |
93 | 93 | } |
94 | 94 | |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | { |
118 | 118 | $classMetadata = $this->createMock(ClassMetadata::class); |
119 | 119 | |
120 | - $this->cmf->fallbackCallback = static function () use ($classMetadata) { |
|
120 | + $this->cmf->fallbackCallback = static function() use ($classMetadata) { |
|
121 | 121 | return $classMetadata; |
122 | 122 | }; |
123 | 123 | |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | |
130 | 130 | public function testWillFailOnFallbackFailureWithNotLoadedMetadata() : void |
131 | 131 | { |
132 | - $this->cmf->fallbackCallback = static function () { |
|
132 | + $this->cmf->fallbackCallback = static function() { |
|
133 | 133 | return null; |
134 | 134 | }; |
135 | 135 |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | |
167 | 167 | private function getManagerFactory() : callable |
168 | 168 | { |
169 | - return function (string $name) { |
|
169 | + return function(string $name) { |
|
170 | 170 | $mock = $this->createMock(ObjectManager::class); |
171 | 171 | |
172 | 172 | $driver = $this->createMock(MappingDriver::class); |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | |
213 | 213 | protected function getService(string $name) : object |
214 | 214 | { |
215 | - if (! isset($this->services[$name])) { |
|
215 | + if (!isset($this->services[$name])) { |
|
216 | 216 | $this->services[$name] = call_user_func($this->managerFactory, $name); |
217 | 217 | } |
218 | 218 |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | { |
17 | 17 | public function testGetPaths() : void |
18 | 18 | { |
19 | - $path = __DIR__ . '/_files'; |
|
19 | + $path = __DIR__.'/_files'; |
|
20 | 20 | $prefix = 'Foo'; |
21 | 21 | |
22 | 22 | $locator = new SymfonyFileLocator([$path => $prefix]); |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | |
29 | 29 | public function testGetPrefixes() : void |
30 | 30 | { |
31 | - $path = __DIR__ . '/_files'; |
|
31 | + $path = __DIR__.'/_files'; |
|
32 | 32 | $prefix = 'Foo'; |
33 | 33 | |
34 | 34 | $locator = new SymfonyFileLocator([$path => $prefix]); |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | |
46 | 46 | public function testFileExists() : void |
47 | 47 | { |
48 | - $path = __DIR__ . '/_files'; |
|
48 | + $path = __DIR__.'/_files'; |
|
49 | 49 | $prefix = 'Foo'; |
50 | 50 | |
51 | 51 | $locator = new SymfonyFileLocator([$path => $prefix], '.yml'); |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | |
59 | 59 | public function testGetAllClassNames() : void |
60 | 60 | { |
61 | - $path = __DIR__ . '/_files'; |
|
61 | + $path = __DIR__.'/_files'; |
|
62 | 62 | $prefix = 'Foo'; |
63 | 63 | |
64 | 64 | $locator = new SymfonyFileLocator([$path => $prefix], '.yml'); |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | |
80 | 80 | public function testInvalidCustomNamespaceSeparator() : void |
81 | 81 | { |
82 | - $path = __DIR__ . '/_files'; |
|
82 | + $path = __DIR__.'/_files'; |
|
83 | 83 | $prefix = 'Foo'; |
84 | 84 | |
85 | 85 | $this->expectException(InvalidArgumentException::class); |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | */ |
110 | 110 | public function testGetClassNamesWithCustomNsSeparator(string $separator, string $dir) : void |
111 | 111 | { |
112 | - $path = __DIR__ . $dir; |
|
112 | + $path = __DIR__.$dir; |
|
113 | 113 | $prefix = 'Foo'; |
114 | 114 | |
115 | 115 | $locator = new SymfonyFileLocator([$path => $prefix], '.yml', $separator); |
@@ -157,29 +157,29 @@ discard block |
||
157 | 157 | */ |
158 | 158 | public function testFindMappingFileWithCustomNsSeparator(string $separator, string $dir, array $files) : void |
159 | 159 | { |
160 | - $path = __DIR__ . $dir; |
|
160 | + $path = __DIR__.$dir; |
|
161 | 161 | $prefix = 'Foo'; |
162 | 162 | |
163 | 163 | $locator = new SymfonyFileLocator([$path => $prefix], '.yml', $separator); |
164 | 164 | |
165 | 165 | foreach ($files as $filePath => $className) { |
166 | - self::assertSame(realpath($path . '/' . $filePath), realpath($locator->findMappingFile($className))); |
|
166 | + self::assertSame(realpath($path.'/'.$filePath), realpath($locator->findMappingFile($className))); |
|
167 | 167 | } |
168 | 168 | } |
169 | 169 | |
170 | 170 | public function testFindMappingFile() : void |
171 | 171 | { |
172 | - $path = __DIR__ . '/_files'; |
|
172 | + $path = __DIR__.'/_files'; |
|
173 | 173 | $prefix = 'Foo'; |
174 | 174 | |
175 | 175 | $locator = new SymfonyFileLocator([$path => $prefix], '.yml'); |
176 | 176 | |
177 | - self::assertSame(__DIR__ . '/_files/stdClass.yml', $locator->findMappingFile('Foo\\stdClass')); |
|
177 | + self::assertSame(__DIR__.'/_files/stdClass.yml', $locator->findMappingFile('Foo\\stdClass')); |
|
178 | 178 | } |
179 | 179 | |
180 | 180 | public function testFindMappingFileNotFound() : void |
181 | 181 | { |
182 | - $path = __DIR__ . '/_files'; |
|
182 | + $path = __DIR__.'/_files'; |
|
183 | 183 | $prefix = 'Foo'; |
184 | 184 | |
185 | 185 | $locator = new SymfonyFileLocator([$path => $prefix], '.yml'); |
@@ -193,13 +193,13 @@ discard block |
||
193 | 193 | { |
194 | 194 | // Low -> High |
195 | 195 | $prefixes = []; |
196 | - $prefixes[__DIR__ . '/_match_ns'] = 'Foo'; |
|
197 | - $prefixes[__DIR__ . '/_match_ns/Bar'] = 'Foo\\Bar'; |
|
196 | + $prefixes[__DIR__.'/_match_ns'] = 'Foo'; |
|
197 | + $prefixes[__DIR__.'/_match_ns/Bar'] = 'Foo\\Bar'; |
|
198 | 198 | |
199 | 199 | $locator = new SymfonyFileLocator($prefixes, '.yml'); |
200 | 200 | |
201 | 201 | self::assertSame( |
202 | - __DIR__ . '/_match_ns/Bar/barEntity.yml', |
|
202 | + __DIR__.'/_match_ns/Bar/barEntity.yml', |
|
203 | 203 | $locator->findMappingFile("Foo\\Bar\\barEntity") |
204 | 204 | ); |
205 | 205 | } |
@@ -207,13 +207,13 @@ discard block |
||
207 | 207 | public function testFindMappingFileMostSpecificNamespaceFirst() : void |
208 | 208 | { |
209 | 209 | $prefixes = []; |
210 | - $prefixes[__DIR__ . '/_match_ns/Bar'] = 'Foo\\Bar'; |
|
211 | - $prefixes[__DIR__ . '/_match_ns'] = 'Foo'; |
|
210 | + $prefixes[__DIR__.'/_match_ns/Bar'] = 'Foo\\Bar'; |
|
211 | + $prefixes[__DIR__.'/_match_ns'] = 'Foo'; |
|
212 | 212 | |
213 | 213 | $locator = new SymfonyFileLocator($prefixes, '.yml'); |
214 | 214 | |
215 | 215 | self::assertSame( |
216 | - __DIR__ . '/_match_ns/Bar/barEntity.yml', |
|
216 | + __DIR__.'/_match_ns/Bar/barEntity.yml', |
|
217 | 217 | $locator->findMappingFile("Foo\\Bar\\barEntity") |
218 | 218 | ); |
219 | 219 | } |
@@ -39,7 +39,7 @@ |
||
39 | 39 | |
40 | 40 | protected function getFqcnFromAlias(string $namespaceAlias, string $simpleClassName) : string |
41 | 41 | { |
42 | - return __NAMESPACE__ . '\\' . $simpleClassName; |
|
42 | + return __NAMESPACE__.'\\'.$simpleClassName; |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | protected function initialize() : void |