@@ -80,10 +80,10 @@ discard block |
||
| 80 | 80 | |
| 81 | 81 | $result = $this->loadMappingFile($this->locator->findMappingFile($className)); |
| 82 | 82 | |
| 83 | - if (! isset($result[$className])) { |
|
| 83 | + if (!isset($result[$className])) { |
|
| 84 | 84 | throw MappingException::invalidMappingFile( |
| 85 | 85 | $className, |
| 86 | - str_replace('\\', '.', $className) . $this->locator->getFileExtension() |
|
| 86 | + str_replace('\\', '.', $className).$this->locator->getFileExtension() |
|
| 87 | 87 | ); |
| 88 | 88 | } |
| 89 | 89 | |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | return false; |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | - return ! $this->locator->fileExists($className); |
|
| 108 | + return !$this->locator->fileExists($className); |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | /** |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | $this->initialize(); |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | - if (! $this->classCache) { |
|
| 120 | + if (!$this->classCache) { |
|
| 121 | 121 | return (array) $this->locator->getAllClassNames($this->globalBasename); |
| 122 | 122 | } |
| 123 | 123 | |
@@ -160,8 +160,8 @@ discard block |
||
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | foreach ($this->locator->getPaths() as $path) { |
| 163 | - $file = $path . '/' . $this->globalBasename . $this->locator->getFileExtension(); |
|
| 164 | - if (! is_file($file)) { |
|
| 163 | + $file = $path.'/'.$this->globalBasename.$this->locator->getFileExtension(); |
|
| 164 | + if (!is_file($file)) { |
|
| 165 | 165 | continue; |
| 166 | 166 | } |
| 167 | 167 | |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | */ |
| 76 | 76 | public function getAllMetadata() : array |
| 77 | 77 | { |
| 78 | - if (! $this->initialized) { |
|
| 78 | + if (!$this->initialized) { |
|
| 79 | 79 | $this->initialize(); |
| 80 | 80 | } |
| 81 | 81 | |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | |
| 163 | 163 | try { |
| 164 | 164 | if ($this->cacheDriver) { |
| 165 | - $cached = $this->cacheDriver->fetch($realClassName . $this->cacheSalt); |
|
| 165 | + $cached = $this->cacheDriver->fetch($realClassName.$this->cacheSalt); |
|
| 166 | 166 | if ($cached instanceof ClassMetadata) { |
| 167 | 167 | $this->loadedMetadata[$realClassName] = $cached; |
| 168 | 168 | |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | } else { |
| 171 | 171 | foreach ($this->loadMetadata($realClassName) as $loadedClassName) { |
| 172 | 172 | $this->cacheDriver->save( |
| 173 | - $loadedClassName . $this->cacheSalt, |
|
| 173 | + $loadedClassName.$this->cacheSalt, |
|
| 174 | 174 | $this->loadedMetadata[$loadedClassName], |
| 175 | 175 | 0 |
| 176 | 176 | ); |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | } catch (MappingException $loadingException) { |
| 183 | 183 | $fallbackMetadataResponse = $this->onNotFoundMetadata($realClassName); |
| 184 | 184 | |
| 185 | - if (! $fallbackMetadataResponse) { |
|
| 185 | + if (!$fallbackMetadataResponse) { |
|
| 186 | 186 | throw $loadingException; |
| 187 | 187 | } |
| 188 | 188 | |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | */ |
| 258 | 258 | protected function loadMetadata(string $name) : array |
| 259 | 259 | { |
| 260 | - if (! $this->initialized) { |
|
| 260 | + if (!$this->initialized) { |
|
| 261 | 261 | $this->initialize(); |
| 262 | 262 | } |
| 263 | 263 | |
@@ -343,7 +343,7 @@ discard block |
||
| 343 | 343 | */ |
| 344 | 344 | public function isTransient(string $class) : bool |
| 345 | 345 | { |
| 346 | - if (! $this->initialized) { |
|
| 346 | + if (!$this->initialized) { |
|
| 347 | 347 | $this->initialize(); |
| 348 | 348 | } |
| 349 | 349 | |
@@ -384,7 +384,7 @@ discard block |
||
| 384 | 384 | */ |
| 385 | 385 | private function getRealClass(string $class) : string |
| 386 | 386 | { |
| 387 | - $pos = strrpos($class, '\\' . Proxy::MARKER . '\\'); |
|
| 387 | + $pos = strrpos($class, '\\'.Proxy::MARKER.'\\'); |
|
| 388 | 388 | |
| 389 | 389 | if ($pos === false) { |
| 390 | 390 | return $class; |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | $name = $this->defaultConnection; |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | - if (! isset($this->connections[$name])) { |
|
| 92 | + if (!isset($this->connections[$name])) { |
|
| 93 | 93 | throw new InvalidArgumentException( |
| 94 | 94 | sprintf('Doctrine %s Connection named "%s" does not exist.', $this->name, $name) |
| 95 | 95 | ); |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | $name = $this->defaultManager; |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | - if (! isset($this->managers[$name])) { |
|
| 149 | + if (!isset($this->managers[$name])) { |
|
| 150 | 150 | throw new InvalidArgumentException( |
| 151 | 151 | sprintf('Doctrine %s Manager named "%s" does not exist.', $this->name, $name) |
| 152 | 152 | ); |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | if (strpos($class, ':') !== false) { |
| 168 | 168 | [$namespaceAlias, $simpleClassName] = explode(':', $class, 2); |
| 169 | 169 | |
| 170 | - $class = $this->getAliasNamespace($namespaceAlias) . '\\' . $simpleClassName; |
|
| 170 | + $class = $this->getAliasNamespace($namespaceAlias).'\\'.$simpleClassName; |
|
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | $proxyClass = new ReflectionClass($class); |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | if ($proxyClass->implementsInterface($this->proxyInterfaceName)) { |
| 176 | 176 | $parentClass = $proxyClass->getParentClass(); |
| 177 | 177 | |
| 178 | - if (! $parentClass) { |
|
| 178 | + if (!$parentClass) { |
|
| 179 | 179 | return null; |
| 180 | 180 | } |
| 181 | 181 | |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | /** @var ObjectManager $manager */ |
| 187 | 187 | $manager = $this->getService($id); |
| 188 | 188 | |
| 189 | - if (! $manager->getMetadataFactory()->isTransient($class)) { |
|
| 189 | + if (!$manager->getMetadataFactory()->isTransient($class)) { |
|
| 190 | 190 | return $manager; |
| 191 | 191 | } |
| 192 | 192 | } |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | $name = $this->defaultManager; |
| 246 | 246 | } |
| 247 | 247 | |
| 248 | - if (! isset($this->managers[$name])) { |
|
| 248 | + if (!isset($this->managers[$name])) { |
|
| 249 | 249 | throw new InvalidArgumentException(sprintf('Doctrine %s Manager named "%s" does not exist.', $this->name, $name)); |
| 250 | 250 | } |
| 251 | 251 | |
@@ -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 |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | { |
| 13 | 13 | public function testGetPaths() : void |
| 14 | 14 | { |
| 15 | - $path = __DIR__ . '/_files'; |
|
| 15 | + $path = __DIR__.'/_files'; |
|
| 16 | 16 | |
| 17 | 17 | $locator = new DefaultFileLocator([$path]); |
| 18 | 18 | self::assertSame([$path], $locator->getPaths()); |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | |
| 32 | 32 | public function testUniquePaths() : void |
| 33 | 33 | { |
| 34 | - $path = __DIR__ . '/_files'; |
|
| 34 | + $path = __DIR__.'/_files'; |
|
| 35 | 35 | |
| 36 | 36 | $locator = new DefaultFileLocator([$path, $path]); |
| 37 | 37 | self::assertSame([$path], $locator->getPaths()); |
@@ -39,16 +39,16 @@ discard block |
||
| 39 | 39 | |
| 40 | 40 | public function testFindMappingFile() : void |
| 41 | 41 | { |
| 42 | - $path = __DIR__ . '/_files'; |
|
| 42 | + $path = __DIR__.'/_files'; |
|
| 43 | 43 | |
| 44 | 44 | $locator = new DefaultFileLocator([$path], '.yml'); |
| 45 | 45 | |
| 46 | - self::assertSame(__DIR__ . '/_files' . DIRECTORY_SEPARATOR . 'stdClass.yml', $locator->findMappingFile('stdClass')); |
|
| 46 | + self::assertSame(__DIR__.'/_files'.DIRECTORY_SEPARATOR.'stdClass.yml', $locator->findMappingFile('stdClass')); |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | public function testFindMappingFileNotFound() : void |
| 50 | 50 | { |
| 51 | - $path = __DIR__ . '/_files'; |
|
| 51 | + $path = __DIR__.'/_files'; |
|
| 52 | 52 | |
| 53 | 53 | $locator = new DefaultFileLocator([$path], '.yml'); |
| 54 | 54 | |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | |
| 60 | 60 | public function testGetAllClassNames() : void |
| 61 | 61 | { |
| 62 | - $path = __DIR__ . '/_files'; |
|
| 62 | + $path = __DIR__.'/_files'; |
|
| 63 | 63 | |
| 64 | 64 | $locator = new DefaultFileLocator([$path], '.yml'); |
| 65 | 65 | $allClasses = $locator->getAllClassNames(null); |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | |
| 80 | 80 | public function testGetAllClassNamesNonMatchingFileExtension() : void |
| 81 | 81 | { |
| 82 | - $path = __DIR__ . '/_files'; |
|
| 82 | + $path = __DIR__.'/_files'; |
|
| 83 | 83 | |
| 84 | 84 | $locator = new DefaultFileLocator([$path], '.xml'); |
| 85 | 85 | self::assertSame([], $locator->getAllClassNames('global')); |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | |
| 88 | 88 | public function testFileExists() : void |
| 89 | 89 | { |
| 90 | - $path = __DIR__ . '/_files'; |
|
| 90 | + $path = __DIR__.'/_files'; |
|
| 91 | 91 | |
| 92 | 92 | $locator = new DefaultFileLocator([$path], '.yml'); |
| 93 | 93 | |
@@ -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 | |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | $locator->expects($this->once()) |
| 39 | 39 | ->method('findMappingFile') |
| 40 | 40 | ->with($this->equalTo('stdClass')) |
| 41 | - ->will($this->returnValue(__DIR__ . '/_files/stdClass.yml')); |
|
| 41 | + ->will($this->returnValue(__DIR__.'/_files/stdClass.yml')); |
|
| 42 | 42 | |
| 43 | 43 | $driver = $this->createTestFileDriver($locator); |
| 44 | 44 | |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | $locator->expects($this->once()) |
| 54 | 54 | ->method('findMappingFile') |
| 55 | 55 | ->with($this->equalTo('stdClass')) |
| 56 | - ->will($this->returnValue(__DIR__ . '/_files/stdClass.yml')); |
|
| 56 | + ->will($this->returnValue(__DIR__.'/_files/stdClass.yml')); |
|
| 57 | 57 | |
| 58 | 58 | $driver = $this->createTestFileDriver($locator); |
| 59 | 59 | |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | |
| 137 | 137 | public function testNonLocatorFallback() : void |
| 138 | 138 | { |
| 139 | - $driver = $this->createTestFileDriver(__DIR__ . '/_files', '.yml'); |
|
| 139 | + $driver = $this->createTestFileDriver(__DIR__.'/_files', '.yml'); |
|
| 140 | 140 | self::assertTrue($driver->isTransient('stdClass2')); |
| 141 | 141 | self::assertFalse($driver->isTransient('stdClass')); |
| 142 | 142 | } |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | { |
| 149 | 149 | $locator = $this->createMock(FileLocator::class); |
| 150 | 150 | $locator->expects($this->any())->method('getFileExtension')->will($this->returnValue('.yml')); |
| 151 | - $locator->expects($this->any())->method('getPaths')->will($this->returnValue([__DIR__ . '/_files'])); |
|
| 151 | + $locator->expects($this->any())->method('getPaths')->will($this->returnValue([__DIR__.'/_files'])); |
|
| 152 | 152 | |
| 153 | 153 | return $locator; |
| 154 | 154 | } |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | public function testGetAllClassNames() : void |
| 17 | 17 | { |
| 18 | 18 | $reader = new AnnotationReader(); |
| 19 | - $driver = new SimpleAnnotationDriver($reader, [__DIR__ . '/_files/annotation']); |
|
| 19 | + $driver = new SimpleAnnotationDriver($reader, [__DIR__.'/_files/annotation']); |
|
| 20 | 20 | |
| 21 | 21 | $classes = $driver->getAllClassNames(); |
| 22 | 22 | |