@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | public function testGetMetadataForAbsentClass() |
48 | 48 | { |
49 | 49 | $this->expectException(MappingException::class); |
50 | - $this->cmf->getMetadataFor(__NAMESPACE__ . '\AbsentClass'); |
|
50 | + $this->cmf->getMetadataFor(__NAMESPACE__.'\AbsentClass'); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | public function testGetParentMetadata() |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | { |
64 | 64 | $metadata = $this->createMock(ClassMetadata::class); |
65 | 65 | $cache = new ArrayCache(); |
66 | - $cache->save(ChildEntity::class . '$CLASSMETADATA', $metadata); |
|
66 | + $cache->save(ChildEntity::class.'$CLASSMETADATA', $metadata); |
|
67 | 67 | |
68 | 68 | $this->cmf->setCacheDriver($cache); |
69 | 69 | |
@@ -77,14 +77,14 @@ discard block |
||
77 | 77 | |
78 | 78 | $loadedMetadata = $this->cmf->getMetadataFor(ChildEntity::class); |
79 | 79 | |
80 | - self::assertSame($loadedMetadata, $cache->fetch(ChildEntity::class . '$CLASSMETADATA')); |
|
80 | + self::assertSame($loadedMetadata, $cache->fetch(ChildEntity::class.'$CLASSMETADATA')); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | public function testGetAliasedMetadata() |
84 | 84 | { |
85 | 85 | $this->cmf->getMetadataFor('prefix:ChildEntity'); |
86 | 86 | |
87 | - self::assertTrue($this->cmf->hasMetadataFor(__NAMESPACE__ . '\ChildEntity')); |
|
87 | + self::assertTrue($this->cmf->hasMetadataFor(__NAMESPACE__.'\ChildEntity')); |
|
88 | 88 | self::assertTrue($this->cmf->hasMetadataFor('prefix:ChildEntity')); |
89 | 89 | } |
90 | 90 | |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | { |
114 | 114 | $classMetadata = $this->createMock(ClassMetadata::class); |
115 | 115 | |
116 | - $this->cmf->fallbackCallback = static function () use ($classMetadata) { |
|
116 | + $this->cmf->fallbackCallback = static function() use ($classMetadata) { |
|
117 | 117 | return $classMetadata; |
118 | 118 | }; |
119 | 119 | |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | |
125 | 125 | public function testWillFailOnFallbackFailureWithNotLoadedMetadata() |
126 | 126 | { |
127 | - $this->cmf->fallbackCallback = static function () { |
|
127 | + $this->cmf->fallbackCallback = static function() { |
|
128 | 128 | return null; |
129 | 129 | }; |
130 | 130 | |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | |
188 | 188 | protected function getFqcnFromAlias(string $namespaceAlias, string $simpleClassName) : string |
189 | 189 | { |
190 | - return __NAMESPACE__ . '\\' . $simpleClassName; |
|
190 | + return __NAMESPACE__.'\\'.$simpleClassName; |
|
191 | 191 | } |
192 | 192 | |
193 | 193 | protected function initialize() : void |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | |
220 | 220 | protected function onNotFoundMetadata($className) |
221 | 221 | { |
222 | - if (! $this->fallbackCallback) { |
|
222 | + if (!$this->fallbackCallback) { |
|
223 | 223 | return null; |
224 | 224 | } |
225 | 225 |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | $locator->expects($this->once()) |
38 | 38 | ->method('findMappingFile') |
39 | 39 | ->with($this->equalTo('stdClass')) |
40 | - ->will($this->returnValue(__DIR__ . '/_files/stdClass.yml')); |
|
40 | + ->will($this->returnValue(__DIR__.'/_files/stdClass.yml')); |
|
41 | 41 | |
42 | 42 | $driver = $this->createTestFileDriver($locator); |
43 | 43 | |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | $locator->expects($this->once()) |
53 | 53 | ->method('findMappingFile') |
54 | 54 | ->with($this->equalTo('stdClass')) |
55 | - ->will($this->returnValue(__DIR__ . '/_files/stdClass.yml')); |
|
55 | + ->will($this->returnValue(__DIR__.'/_files/stdClass.yml')); |
|
56 | 56 | |
57 | 57 | $driver = $this->createTestFileDriver($locator); |
58 | 58 | |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | |
136 | 136 | public function testNonLocatorFallback() |
137 | 137 | { |
138 | - $driver = $this->createTestFileDriver(__DIR__ . '/_files', '.yml'); |
|
138 | + $driver = $this->createTestFileDriver(__DIR__.'/_files', '.yml'); |
|
139 | 139 | self::assertTrue($driver->isTransient('stdClass2')); |
140 | 140 | self::assertFalse($driver->isTransient('stdClass')); |
141 | 141 | } |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | { |
145 | 145 | $locator = $this->createMock(FileLocator::class); |
146 | 146 | $locator->expects($this->any())->method('getFileExtension')->will($this->returnValue('.yml')); |
147 | - $locator->expects($this->any())->method('getPaths')->will($this->returnValue([__DIR__ . '/_files'])); |
|
147 | + $locator->expects($this->any())->method('getPaths')->will($this->returnValue([__DIR__.'/_files'])); |
|
148 | 148 | |
149 | 149 | return $locator; |
150 | 150 | } |
@@ -37,7 +37,7 @@ |
||
37 | 37 | $this->objectManager = $this->createMock(ObjectManager::class); |
38 | 38 | |
39 | 39 | $this->objectManager->expects($this->any())->method('getClassMetadata') |
40 | - ->will($this->returnValue($this->cm)); |
|
40 | + ->will($this->returnValue($this->cm)); |
|
41 | 41 | |
42 | 42 | $this->object = new TestObject(); |
43 | 43 |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | |
198 | 198 | public function getAssociationTargetClass(string $assocName) : string |
199 | 199 | { |
200 | - return __NAMESPACE__ . '\TestObject'; |
|
200 | + return __NAMESPACE__.'\TestObject'; |
|
201 | 201 | } |
202 | 202 | |
203 | 203 | /** |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | |
219 | 219 | public function getName() : string |
220 | 220 | { |
221 | - return __NAMESPACE__ . '\TestObject'; |
|
221 | + return __NAMESPACE__.'\TestObject'; |
|
222 | 222 | } |
223 | 223 | |
224 | 224 | public function getReflectionClass() : ReflectionClass |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | |
81 | 81 | private function getManagerFactory() |
82 | 82 | { |
83 | - return function () { |
|
83 | + return function() { |
|
84 | 84 | $mock = $this->createMock(ObjectManager::class); |
85 | 85 | |
86 | 86 | $driver = $this->createMock(MappingDriver::class); |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | |
121 | 121 | protected function getService(string $name) : object |
122 | 122 | { |
123 | - if (! isset($this->services[$name])) { |
|
123 | + if (!isset($this->services[$name])) { |
|
124 | 124 | $this->services[$name] = call_user_func($this->managerFactory); |
125 | 125 | } |
126 | 126 |
@@ -75,7 +75,7 @@ |
||
75 | 75 | { |
76 | 76 | $this->markTestSkipped('This test needs to be rewritten'); |
77 | 77 | |
78 | - $returnedValue = $isVoidMethod ? null : 'INNER VALUE FROM ' . $method; |
|
78 | + $returnedValue = $isVoidMethod ? null : 'INNER VALUE FROM '.$method; |
|
79 | 79 | $stub = $this->wrapped |
80 | 80 | ->expects($this->once()) |
81 | 81 | ->method($method) |
@@ -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 |
@@ -121,11 +121,11 @@ discard block |
||
121 | 121 | */ |
122 | 122 | public function fileExists(string $className) : bool |
123 | 123 | { |
124 | - $defaultFileName = str_replace('\\', $this->nsSeparator, $className) . $this->fileExtension; |
|
124 | + $defaultFileName = str_replace('\\', $this->nsSeparator, $className).$this->fileExtension; |
|
125 | 125 | foreach ($this->paths as $path) { |
126 | - if (! isset($this->prefixes[$path])) { |
|
126 | + if (!isset($this->prefixes[$path])) { |
|
127 | 127 | // global namespace class |
128 | - if (is_file($path . DIRECTORY_SEPARATOR . $defaultFileName)) { |
|
128 | + if (is_file($path.DIRECTORY_SEPARATOR.$defaultFileName)) { |
|
129 | 129 | return true; |
130 | 130 | } |
131 | 131 | |
@@ -134,11 +134,11 @@ discard block |
||
134 | 134 | |
135 | 135 | $prefix = $this->prefixes[$path]; |
136 | 136 | |
137 | - if (strpos($className, $prefix . '\\') !== 0) { |
|
137 | + if (strpos($className, $prefix.'\\') !== 0) { |
|
138 | 138 | continue; |
139 | 139 | } |
140 | 140 | |
141 | - $filename = $path . '/' . strtr(substr($className, strlen($prefix) + 1), '\\', $this->nsSeparator) . $this->fileExtension; |
|
141 | + $filename = $path.'/'.strtr(substr($className, strlen($prefix) + 1), '\\', $this->nsSeparator).$this->fileExtension; |
|
142 | 142 | if (is_file($filename)) { |
143 | 143 | return true; |
144 | 144 | } |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | |
157 | 157 | if ($this->paths) { |
158 | 158 | foreach ((array) $this->paths as $path) { |
159 | - if (! is_dir($path)) { |
|
159 | + if (!is_dir($path)) { |
|
160 | 160 | throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path); |
161 | 161 | } |
162 | 162 | |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | '\\' |
182 | 182 | ); |
183 | 183 | |
184 | - $classes[] = $this->prefixes[$path] . str_replace(DIRECTORY_SEPARATOR, '\\', $nsSuffix) . '\\' . str_replace($this->nsSeparator, '\\', $fileName); |
|
184 | + $classes[] = $this->prefixes[$path].str_replace(DIRECTORY_SEPARATOR, '\\', $nsSuffix).'\\'.str_replace($this->nsSeparator, '\\', $fileName); |
|
185 | 185 | } else { |
186 | 186 | $classes[] = str_replace($this->nsSeparator, '\\', $fileName); |
187 | 187 | } |
@@ -197,11 +197,11 @@ discard block |
||
197 | 197 | */ |
198 | 198 | public function findMappingFile(string $className) : string |
199 | 199 | { |
200 | - $defaultFileName = str_replace('\\', $this->nsSeparator, $className) . $this->fileExtension; |
|
200 | + $defaultFileName = str_replace('\\', $this->nsSeparator, $className).$this->fileExtension; |
|
201 | 201 | foreach ($this->paths as $path) { |
202 | - if (! isset($this->prefixes[$path])) { |
|
203 | - if (is_file($path . DIRECTORY_SEPARATOR . $defaultFileName)) { |
|
204 | - return $path . DIRECTORY_SEPARATOR . $defaultFileName; |
|
202 | + if (!isset($this->prefixes[$path])) { |
|
203 | + if (is_file($path.DIRECTORY_SEPARATOR.$defaultFileName)) { |
|
204 | + return $path.DIRECTORY_SEPARATOR.$defaultFileName; |
|
205 | 205 | } |
206 | 206 | |
207 | 207 | continue; |
@@ -209,16 +209,16 @@ discard block |
||
209 | 209 | |
210 | 210 | $prefix = $this->prefixes[$path]; |
211 | 211 | |
212 | - if (strpos($className, $prefix . '\\') !== 0) { |
|
212 | + if (strpos($className, $prefix.'\\') !== 0) { |
|
213 | 213 | continue; |
214 | 214 | } |
215 | 215 | |
216 | - $filename = $path . '/' . strtr(substr($className, strlen($prefix) + 1), '\\', $this->nsSeparator) . $this->fileExtension; |
|
216 | + $filename = $path.'/'.strtr(substr($className, strlen($prefix) + 1), '\\', $this->nsSeparator).$this->fileExtension; |
|
217 | 217 | if (is_file($filename)) { |
218 | 218 | return $filename; |
219 | 219 | } |
220 | 220 | } |
221 | 221 | |
222 | - throw MappingException::mappingFileNotFound($className, substr($className, strrpos($className, '\\') + 1) . $this->fileExtension); |
|
222 | + throw MappingException::mappingFileNotFound($className, substr($className, strrpos($className, '\\') + 1).$this->fileExtension); |
|
223 | 223 | } |
224 | 224 | } |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | return $this->classNames; |
73 | 73 | } |
74 | 74 | |
75 | - if (! $this->paths) { |
|
75 | + if (!$this->paths) { |
|
76 | 76 | throw MappingException::pathRequired(); |
77 | 77 | } |
78 | 78 | |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | $includedFiles = []; |
81 | 81 | |
82 | 82 | foreach ($this->paths as $path) { |
83 | - if (! is_dir($path)) { |
|
83 | + if (!is_dir($path)) { |
|
84 | 84 | throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path); |
85 | 85 | } |
86 | 86 | |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | foreach ($declared as $className) { |
106 | 106 | $rc = new ReflectionClass($className); |
107 | 107 | $sourceFile = $rc->getFileName(); |
108 | - if (! in_array($sourceFile, $includedFiles) || $this->isTransient($className)) { |
|
108 | + if (!in_array($sourceFile, $includedFiles) || $this->isTransient($className)) { |
|
109 | 109 | continue; |
110 | 110 | } |
111 | 111 | |
@@ -122,6 +122,6 @@ discard block |
||
122 | 122 | */ |
123 | 123 | public function isTransient(string $className) : bool |
124 | 124 | { |
125 | - return ! method_exists($className, 'loadMetadata'); |
|
125 | + return !method_exists($className, 'loadMetadata'); |
|
126 | 126 | } |
127 | 127 | } |
@@ -90,12 +90,12 @@ discard block |
||
90 | 90 | */ |
91 | 91 | public function findMappingFile(string $className) : string |
92 | 92 | { |
93 | - $fileName = str_replace('\\', '.', $className) . $this->fileExtension; |
|
93 | + $fileName = str_replace('\\', '.', $className).$this->fileExtension; |
|
94 | 94 | |
95 | 95 | // Check whether file exists |
96 | 96 | foreach ($this->paths as $path) { |
97 | - if (is_file($path . DIRECTORY_SEPARATOR . $fileName)) { |
|
98 | - return $path . DIRECTORY_SEPARATOR . $fileName; |
|
97 | + if (is_file($path.DIRECTORY_SEPARATOR.$fileName)) { |
|
98 | + return $path.DIRECTORY_SEPARATOR.$fileName; |
|
99 | 99 | } |
100 | 100 | } |
101 | 101 | |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | |
112 | 112 | if ($this->paths) { |
113 | 113 | foreach ($this->paths as $path) { |
114 | - if (! is_dir($path)) { |
|
114 | + if (!is_dir($path)) { |
|
115 | 115 | throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path); |
116 | 116 | } |
117 | 117 | |
@@ -141,11 +141,11 @@ discard block |
||
141 | 141 | */ |
142 | 142 | public function fileExists(string $className) : bool |
143 | 143 | { |
144 | - $fileName = str_replace('\\', '.', $className) . $this->fileExtension; |
|
144 | + $fileName = str_replace('\\', '.', $className).$this->fileExtension; |
|
145 | 145 | |
146 | 146 | // Check whether file exists |
147 | 147 | foreach ((array) $this->paths as $path) { |
148 | - if (is_file($path . DIRECTORY_SEPARATOR . $fileName)) { |
|
148 | + if (is_file($path.DIRECTORY_SEPARATOR.$fileName)) { |
|
149 | 149 | return true; |
150 | 150 | } |
151 | 151 | } |