@@ -26,18 +26,18 @@ |
||
| 26 | 26 | |
| 27 | 27 | public static function pathRequired() : self |
| 28 | 28 | { |
| 29 | - return new self('Specifying the paths to your entities is required ' . |
|
| 29 | + return new self('Specifying the paths to your entities is required '. |
|
| 30 | 30 | 'in the AnnotationDriver to retrieve all class names.'); |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | public static function fileMappingDriversRequireConfiguredDirectoryPath(?string $path = null) : self |
| 34 | 34 | { |
| 35 | - if (! empty($path)) { |
|
| 36 | - $path = '[' . $path . ']'; |
|
| 35 | + if (!empty($path)) { |
|
| 36 | + $path = '['.$path.']'; |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | return new self(sprintf( |
| 40 | - 'File mapping drivers must have a valid directory path, ' . |
|
| 40 | + 'File mapping drivers must have a valid directory path, '. |
|
| 41 | 41 | 'however the given path %s seems to be incorrect!', |
| 42 | 42 | $path |
| 43 | 43 | )); |
@@ -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 | |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | |
| 154 | 154 | try { |
| 155 | 155 | if ($this->cacheDriver) { |
| 156 | - $cached = $this->cacheDriver->fetch($realClassName . $this->cacheSalt); |
|
| 156 | + $cached = $this->cacheDriver->fetch($realClassName.$this->cacheSalt); |
|
| 157 | 157 | if ($cached instanceof ClassMetadata) { |
| 158 | 158 | $this->loadedMetadata[$realClassName] = $cached; |
| 159 | 159 | |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | } else { |
| 162 | 162 | foreach ($this->loadMetadata($realClassName) as $loadedClassName) { |
| 163 | 163 | $this->cacheDriver->save( |
| 164 | - $loadedClassName . $this->cacheSalt, |
|
| 164 | + $loadedClassName.$this->cacheSalt, |
|
| 165 | 165 | $this->loadedMetadata[$loadedClassName], |
| 166 | 166 | null |
| 167 | 167 | ); |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | } catch (MappingException $loadingException) { |
| 174 | 174 | $fallbackMetadataResponse = $this->onNotFoundMetadata($realClassName); |
| 175 | 175 | |
| 176 | - if (! $fallbackMetadataResponse instanceof ClassMetadata) { |
|
| 176 | + if (!$fallbackMetadataResponse instanceof ClassMetadata) { |
|
| 177 | 177 | throw $loadingException; |
| 178 | 178 | } |
| 179 | 179 | |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | */ |
| 246 | 246 | protected function loadMetadata(string $name) : array |
| 247 | 247 | { |
| 248 | - if (! $this->initialized) { |
|
| 248 | + if (!$this->initialized) { |
|
| 249 | 249 | $this->initialize(); |
| 250 | 250 | } |
| 251 | 251 | |
@@ -324,7 +324,7 @@ discard block |
||
| 324 | 324 | */ |
| 325 | 325 | public function isTransient(string $class) : bool |
| 326 | 326 | { |
| 327 | - if (! $this->initialized) { |
|
| 327 | + if (!$this->initialized) { |
|
| 328 | 328 | $this->initialize(); |
| 329 | 329 | } |
| 330 | 330 | |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | */ |
| 24 | 24 | public static function getRealClass(string $class) : string |
| 25 | 25 | { |
| 26 | - $pos = strrpos($class, '\\' . Proxy::MARKER . '\\'); |
|
| 26 | + $pos = strrpos($class, '\\'.Proxy::MARKER.'\\'); |
|
| 27 | 27 | |
| 28 | 28 | if ($pos === false) { |
| 29 | 29 | return $class; |
@@ -73,6 +73,6 @@ discard block |
||
| 73 | 73 | */ |
| 74 | 74 | public static function generateProxyClassName(string $className, string $proxyNamespace) : string |
| 75 | 75 | { |
| 76 | - return rtrim($proxyNamespace, '\\') . '\\' . Proxy::MARKER . '\\' . ltrim($className, '\\'); |
|
| 76 | + return rtrim($proxyNamespace, '\\').'\\'.Proxy::MARKER.'\\'.ltrim($className, '\\'); |
|
| 77 | 77 | } |
| 78 | 78 | } |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | { |
| 24 | 24 | $name = $this->getName(); |
| 25 | 25 | |
| 26 | - if ($object instanceof Proxy && ! $object->__isInitialized()) { |
|
| 26 | + if ($object instanceof Proxy && !$object->__isInitialized()) { |
|
| 27 | 27 | $originalInitializer = $object->__getInitializer(); |
| 28 | 28 | $object->__setInitializer(null); |
| 29 | 29 | $val = $object->$name ?? null; |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | public function setValue($object, $value = null) |
| 46 | 46 | { |
| 47 | - if (! ($object instanceof Proxy && ! $object->__isInitialized())) { |
|
| 47 | + if (!($object instanceof Proxy && !$object->__isInitialized())) { |
|
| 48 | 48 | parent::setValue($object, $value); |
| 49 | 49 | |
| 50 | 50 | return; |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | |
| 82 | 82 | private function getManagerFactory() : callable |
| 83 | 83 | { |
| 84 | - return function () { |
|
| 84 | + return function() { |
|
| 85 | 85 | $mock = $this->createMock(ObjectManager::class); |
| 86 | 86 | $driver = $this->createMock(MappingDriver::class); |
| 87 | 87 | $metadata = $this->createMock(ClassMetadata::class); |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | */ |
| 131 | 131 | protected function getService(string $name) |
| 132 | 132 | { |
| 133 | - if (! isset($this->services[$name])) { |
|
| 133 | + if (!isset($this->services[$name])) { |
|
| 134 | 134 | $this->services[$name] = call_user_func($this->managerFactory); |
| 135 | 135 | } |
| 136 | 136 | |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | public function testGetParentClasses() : void |
| 36 | 36 | { |
| 37 | 37 | $classes = $this->reflectionService->getParentClasses(__CLASS__); |
| 38 | - self::assertTrue(count($classes) === 0, 'The test class ' . __CLASS__ . ' should have no parents according to static reflection.'); |
|
| 38 | + self::assertTrue(count($classes) === 0, 'The test class '.__CLASS__.' should have no parents according to static reflection.'); |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | public function testGetReflectionClass() : void |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | { |
| 15 | 15 | public function testGetPaths() : void |
| 16 | 16 | { |
| 17 | - $path = __DIR__ . '/_files'; |
|
| 17 | + $path = __DIR__.'/_files'; |
|
| 18 | 18 | |
| 19 | 19 | $locator = new DefaultFileLocator([$path]); |
| 20 | 20 | self::assertEquals([$path], $locator->getPaths()); |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | |
| 34 | 34 | public function testUniquePaths() : void |
| 35 | 35 | { |
| 36 | - $path = __DIR__ . '/_files'; |
|
| 36 | + $path = __DIR__.'/_files'; |
|
| 37 | 37 | |
| 38 | 38 | $locator = new DefaultFileLocator([$path, $path]); |
| 39 | 39 | self::assertEquals([$path], $locator->getPaths()); |
@@ -41,16 +41,16 @@ discard block |
||
| 41 | 41 | |
| 42 | 42 | public function testFindMappingFile() : void |
| 43 | 43 | { |
| 44 | - $path = __DIR__ . '/_files'; |
|
| 44 | + $path = __DIR__.'/_files'; |
|
| 45 | 45 | |
| 46 | 46 | $locator = new DefaultFileLocator([$path], '.yml'); |
| 47 | 47 | |
| 48 | - self::assertEquals(__DIR__ . '/_files' . DIRECTORY_SEPARATOR . 'stdClass.yml', $locator->findMappingFile('stdClass')); |
|
| 48 | + self::assertEquals(__DIR__.'/_files'.DIRECTORY_SEPARATOR.'stdClass.yml', $locator->findMappingFile('stdClass')); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | public function testFindMappingFileNotFound() : void |
| 52 | 52 | { |
| 53 | - $path = __DIR__ . '/_files'; |
|
| 53 | + $path = __DIR__.'/_files'; |
|
| 54 | 54 | |
| 55 | 55 | $locator = new DefaultFileLocator([$path], '.yml'); |
| 56 | 56 | |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | |
| 62 | 62 | public function testGetAllClassNames() : void |
| 63 | 63 | { |
| 64 | - $path = __DIR__ . '/_files'; |
|
| 64 | + $path = __DIR__.'/_files'; |
|
| 65 | 65 | |
| 66 | 66 | $locator = new DefaultFileLocator([$path], '.yml'); |
| 67 | 67 | $allClasses = $locator->getAllClassNames(); |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | |
| 82 | 82 | public function testGetAllClassNamesNonMatchingFileExtension() : void |
| 83 | 83 | { |
| 84 | - $path = __DIR__ . '/_files'; |
|
| 84 | + $path = __DIR__.'/_files'; |
|
| 85 | 85 | |
| 86 | 86 | $locator = new DefaultFileLocator([$path], '.xml'); |
| 87 | 87 | self::assertEquals([], $locator->getAllClassNames('global')); |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | |
| 90 | 90 | public function testFileExists() : void |
| 91 | 91 | { |
| 92 | - $path = __DIR__ . '/_files'; |
|
| 92 | + $path = __DIR__.'/_files'; |
|
| 93 | 93 | |
| 94 | 94 | $locator = new DefaultFileLocator([$path], '.yml'); |
| 95 | 95 | |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | { |
| 16 | 16 | public function testGetPaths() : void |
| 17 | 17 | { |
| 18 | - $path = __DIR__ . '/_files'; |
|
| 18 | + $path = __DIR__.'/_files'; |
|
| 19 | 19 | $prefix = 'Foo'; |
| 20 | 20 | |
| 21 | 21 | $locator = new SymfonyFileLocator([$path => $prefix]); |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | public function testGetPrefixes() : void |
| 29 | 29 | { |
| 30 | - $path = __DIR__ . '/_files'; |
|
| 30 | + $path = __DIR__.'/_files'; |
|
| 31 | 31 | $prefix = 'Foo'; |
| 32 | 32 | |
| 33 | 33 | $locator = new SymfonyFileLocator([$path => $prefix]); |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | |
| 45 | 45 | public function testFileExists() : void |
| 46 | 46 | { |
| 47 | - $path = __DIR__ . '/_files'; |
|
| 47 | + $path = __DIR__.'/_files'; |
|
| 48 | 48 | $prefix = 'Foo'; |
| 49 | 49 | |
| 50 | 50 | $locator = new SymfonyFileLocator([$path => $prefix], '.yml'); |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | |
| 58 | 58 | public function testGetAllClassNames() : void |
| 59 | 59 | { |
| 60 | - $path = __DIR__ . '/_files'; |
|
| 60 | + $path = __DIR__.'/_files'; |
|
| 61 | 61 | $prefix = 'Foo'; |
| 62 | 62 | |
| 63 | 63 | $locator = new SymfonyFileLocator([$path => $prefix], '.yml'); |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | */ |
| 83 | 83 | public function testInvalidCustomNamespaceSeparator() : void |
| 84 | 84 | { |
| 85 | - $path = __DIR__ . '/_files'; |
|
| 85 | + $path = __DIR__.'/_files'; |
|
| 86 | 86 | $prefix = 'Foo'; |
| 87 | 87 | |
| 88 | 88 | new SymfonyFileLocator([$path => $prefix], '.yml', null); |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | */ |
| 107 | 107 | public function testGetClassNamesWithCustomNsSeparator(string $separator, string $dir) : void |
| 108 | 108 | { |
| 109 | - $path = __DIR__ . $dir; |
|
| 109 | + $path = __DIR__.$dir; |
|
| 110 | 110 | $prefix = 'Foo'; |
| 111 | 111 | |
| 112 | 112 | $locator = new SymfonyFileLocator([$path => $prefix], '.yml', $separator); |
@@ -152,30 +152,30 @@ discard block |
||
| 152 | 152 | */ |
| 153 | 153 | public function testFindMappingFileWithCustomNsSeparator(string $separator, string $dir, array $files) : void |
| 154 | 154 | { |
| 155 | - $path = __DIR__ . $dir; |
|
| 155 | + $path = __DIR__.$dir; |
|
| 156 | 156 | $prefix = 'Foo'; |
| 157 | 157 | |
| 158 | 158 | $locator = new SymfonyFileLocator([$path => $prefix], '.yml', $separator); |
| 159 | 159 | |
| 160 | 160 | foreach ($files as $filePath => $className) { |
| 161 | - self::assertEquals(realpath($path . '/' . $filePath), realpath($locator->findMappingFile($className))); |
|
| 161 | + self::assertEquals(realpath($path.'/'.$filePath), realpath($locator->findMappingFile($className))); |
|
| 162 | 162 | } |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | |
| 166 | 166 | public function testFindMappingFile() : void |
| 167 | 167 | { |
| 168 | - $path = __DIR__ . '/_files'; |
|
| 168 | + $path = __DIR__.'/_files'; |
|
| 169 | 169 | $prefix = 'Foo'; |
| 170 | 170 | |
| 171 | 171 | $locator = new SymfonyFileLocator([$path => $prefix], '.yml'); |
| 172 | 172 | |
| 173 | - self::assertEquals(__DIR__ . '/_files/stdClass.yml', $locator->findMappingFile('Foo\\stdClass')); |
|
| 173 | + self::assertEquals(__DIR__.'/_files/stdClass.yml', $locator->findMappingFile('Foo\\stdClass')); |
|
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | public function testFindMappingFileNotFound() : void |
| 177 | 177 | { |
| 178 | - $path = __DIR__ . '/_files'; |
|
| 178 | + $path = __DIR__.'/_files'; |
|
| 179 | 179 | $prefix = 'Foo'; |
| 180 | 180 | |
| 181 | 181 | $locator = new SymfonyFileLocator([$path => $prefix], '.yml'); |
@@ -189,13 +189,13 @@ discard block |
||
| 189 | 189 | { |
| 190 | 190 | // Low -> High |
| 191 | 191 | $prefixes = []; |
| 192 | - $prefixes[__DIR__ . '/_match_ns'] = 'Foo'; |
|
| 193 | - $prefixes[__DIR__ . '/_match_ns/Bar'] = 'Foo\\Bar'; |
|
| 192 | + $prefixes[__DIR__.'/_match_ns'] = 'Foo'; |
|
| 193 | + $prefixes[__DIR__.'/_match_ns/Bar'] = 'Foo\\Bar'; |
|
| 194 | 194 | |
| 195 | 195 | $locator = new SymfonyFileLocator($prefixes, '.yml'); |
| 196 | 196 | |
| 197 | 197 | self::assertEquals( |
| 198 | - __DIR__ . '/_match_ns/Bar/barEntity.yml', |
|
| 198 | + __DIR__.'/_match_ns/Bar/barEntity.yml', |
|
| 199 | 199 | $locator->findMappingFile("Foo\\Bar\\barEntity") |
| 200 | 200 | ); |
| 201 | 201 | } |
@@ -203,13 +203,13 @@ discard block |
||
| 203 | 203 | public function testFindMappingFileMostSpecificNamespaceFirst() : void |
| 204 | 204 | { |
| 205 | 205 | $prefixes = []; |
| 206 | - $prefixes[__DIR__ . '/_match_ns/Bar'] = 'Foo\\Bar'; |
|
| 207 | - $prefixes[__DIR__ . '/_match_ns'] = 'Foo'; |
|
| 206 | + $prefixes[__DIR__.'/_match_ns/Bar'] = 'Foo\\Bar'; |
|
| 207 | + $prefixes[__DIR__.'/_match_ns'] = 'Foo'; |
|
| 208 | 208 | |
| 209 | 209 | $locator = new SymfonyFileLocator($prefixes, '.yml'); |
| 210 | 210 | |
| 211 | 211 | self::assertEquals( |
| 212 | - __DIR__ . '/_match_ns/Bar/barEntity.yml', |
|
| 212 | + __DIR__.'/_match_ns/Bar/barEntity.yml', |
|
| 213 | 213 | $locator->findMappingFile("Foo\\Bar\\barEntity") |
| 214 | 214 | ); |
| 215 | 215 | } |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | $metadata = $this->createMock(ClassMetadata::class); |
| 17 | 17 | $metadata->expects($this->once())->method('getFieldNames'); |
| 18 | 18 | |
| 19 | - $driver = new PHPDriver([__DIR__ . '/_files']); |
|
| 19 | + $driver = new PHPDriver([__DIR__.'/_files']); |
|
| 20 | 20 | $driver->loadMetadataForClass('TestEntity', $metadata); |
| 21 | 21 | } |
| 22 | 22 | } |