@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | return; |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | - if (! is_array($paths)) { |
|
| 92 | + if (!is_array($paths)) { |
|
| 93 | 93 | $paths = [$paths]; |
| 94 | 94 | } |
| 95 | 95 | |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | $includedFiles = []; |
| 200 | 200 | |
| 201 | 201 | foreach ($this->paths as $path) { |
| 202 | - if (! is_dir($path)) { |
|
| 202 | + if (!is_dir($path)) { |
|
| 203 | 203 | throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path); |
| 204 | 204 | } |
| 205 | 205 | |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | new RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS), |
| 209 | 209 | RecursiveIteratorIterator::LEAVES_ONLY |
| 210 | 210 | ), |
| 211 | - '/^.+' . preg_quote($this->fileExtension) . '$/i', |
|
| 211 | + '/^.+'.preg_quote($this->fileExtension).'$/i', |
|
| 212 | 212 | RecursiveRegexIterator::GET_MATCH |
| 213 | 213 | ); |
| 214 | 214 | |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | |
| 245 | 245 | $sourceFile = $rc->getFileName(); |
| 246 | 246 | |
| 247 | - if (! in_array($sourceFile, $includedFiles, true) || $this->isTransient($className)) { |
|
| 247 | + if (!in_array($sourceFile, $includedFiles, true) || $this->isTransient($className)) { |
|
| 248 | 248 | continue; |
| 249 | 249 | } |
| 250 | 250 | |
@@ -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::assertSame([$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::assertSame([$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::assertSame(__DIR__ . '/_files' . DIRECTORY_SEPARATOR . 'stdClass.yml', $locator->findMappingFile('stdClass')); |
|
| 48 | + self::assertSame(__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::assertSame([], $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 | |
@@ -23,13 +23,13 @@ discard block |
||
| 23 | 23 | public function testAddGetPaths() : void |
| 24 | 24 | { |
| 25 | 25 | self::assertSame([ |
| 26 | - __DIR__ . '/_files/annotation', |
|
| 26 | + __DIR__.'/_files/annotation', |
|
| 27 | 27 | ], $this->driver->getPaths()); |
| 28 | 28 | |
| 29 | 29 | $this->driver->addPaths(['/test/path1', '/test/path2']); |
| 30 | 30 | |
| 31 | 31 | self::assertSame([ |
| 32 | - __DIR__ . '/_files/annotation', |
|
| 32 | + __DIR__.'/_files/annotation', |
|
| 33 | 33 | '/test/path1', |
| 34 | 34 | '/test/path2', |
| 35 | 35 | ], $this->driver->getPaths()); |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | |
| 82 | 82 | $this->driver = new SimpleAnnotationDriver( |
| 83 | 83 | $this->reader, |
| 84 | - [__DIR__ . '/_files/annotation'] |
|
| 84 | + [__DIR__.'/_files/annotation'] |
|
| 85 | 85 | ); |
| 86 | 86 | } |
| 87 | 87 | } |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | */ |
| 82 | 82 | public function getAllMetadata() |
| 83 | 83 | { |
| 84 | - if (! $this->initialized) { |
|
| 84 | + if (!$this->initialized) { |
|
| 85 | 85 | $this->initialize(); |
| 86 | 86 | } |
| 87 | 87 | |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | |
| 183 | 183 | try { |
| 184 | 184 | if ($this->cacheDriver !== null) { |
| 185 | - $cached = $this->cacheDriver->fetch($realClassName . $this->cacheSalt); |
|
| 185 | + $cached = $this->cacheDriver->fetch($realClassName.$this->cacheSalt); |
|
| 186 | 186 | |
| 187 | 187 | if ($cached instanceof ClassMetadata) { |
| 188 | 188 | $this->loadedMetadata[$realClassName] = $cached; |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | } else { |
| 192 | 192 | foreach ($this->loadMetadata($realClassName) as $loadedClassName) { |
| 193 | 193 | $this->cacheDriver->save( |
| 194 | - $loadedClassName . $this->cacheSalt, |
|
| 194 | + $loadedClassName.$this->cacheSalt, |
|
| 195 | 195 | $this->loadedMetadata[$loadedClassName] |
| 196 | 196 | ); |
| 197 | 197 | } |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | */ |
| 280 | 280 | protected function loadMetadata(string $name) |
| 281 | 281 | { |
| 282 | - if (! $this->initialized) { |
|
| 282 | + if (!$this->initialized) { |
|
| 283 | 283 | $this->initialize(); |
| 284 | 284 | } |
| 285 | 285 | |
@@ -368,7 +368,7 @@ discard block |
||
| 368 | 368 | */ |
| 369 | 369 | public function isTransient(string $class) |
| 370 | 370 | { |
| 371 | - if (! $this->initialized) { |
|
| 371 | + if (!$this->initialized) { |
|
| 372 | 372 | $this->initialize(); |
| 373 | 373 | } |
| 374 | 374 | |
@@ -411,7 +411,7 @@ discard block |
||
| 411 | 411 | */ |
| 412 | 412 | private function getRealClass(string $class) : string |
| 413 | 413 | { |
| 414 | - $pos = strrpos($class, '\\' . Proxy::MARKER . '\\'); |
|
| 414 | + $pos = strrpos($class, '\\'.Proxy::MARKER.'\\'); |
|
| 415 | 415 | |
| 416 | 416 | if ($pos === false) { |
| 417 | 417 | return $class; |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | $includedFiles = []; |
| 83 | 83 | |
| 84 | 84 | foreach ($this->paths as $path) { |
| 85 | - if (! is_dir($path)) { |
|
| 85 | + if (!is_dir($path)) { |
|
| 86 | 86 | throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path); |
| 87 | 87 | } |
| 88 | 88 | |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | |
| 110 | 110 | $sourceFile = $rc->getFileName(); |
| 111 | 111 | |
| 112 | - if (! in_array($sourceFile, $includedFiles, true) || $this->isTransient($className)) { |
|
| 112 | + if (!in_array($sourceFile, $includedFiles, true) || $this->isTransient($className)) { |
|
| 113 | 113 | continue; |
| 114 | 114 | } |
| 115 | 115 | |
@@ -126,6 +126,6 @@ discard block |
||
| 126 | 126 | */ |
| 127 | 127 | public function isTransient(string $className) |
| 128 | 128 | { |
| 129 | - return ! method_exists($className, 'loadMetadata'); |
|
| 129 | + return !method_exists($className, 'loadMetadata'); |
|
| 130 | 130 | } |
| 131 | 131 | } |
@@ -134,11 +134,11 @@ discard block |
||
| 134 | 134 | */ |
| 135 | 135 | public function fileExists(string $className) |
| 136 | 136 | { |
| 137 | - $defaultFileName = str_replace('\\', $this->nsSeparator, $className) . $this->fileExtension; |
|
| 137 | + $defaultFileName = str_replace('\\', $this->nsSeparator, $className).$this->fileExtension; |
|
| 138 | 138 | foreach ($this->paths as $path) { |
| 139 | - if (! isset($this->prefixes[$path])) { |
|
| 139 | + if (!isset($this->prefixes[$path])) { |
|
| 140 | 140 | // global namespace class |
| 141 | - if (is_file($path . DIRECTORY_SEPARATOR . $defaultFileName)) { |
|
| 141 | + if (is_file($path.DIRECTORY_SEPARATOR.$defaultFileName)) { |
|
| 142 | 142 | return true; |
| 143 | 143 | } |
| 144 | 144 | |
@@ -147,11 +147,11 @@ discard block |
||
| 147 | 147 | |
| 148 | 148 | $prefix = $this->prefixes[$path]; |
| 149 | 149 | |
| 150 | - if (strpos($className, $prefix . '\\') !== 0) { |
|
| 150 | + if (strpos($className, $prefix.'\\') !== 0) { |
|
| 151 | 151 | continue; |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | - $filename = $path . '/' . strtr(substr($className, strlen($prefix) + 1), '\\', $this->nsSeparator) . $this->fileExtension; |
|
| 154 | + $filename = $path.'/'.strtr(substr($className, strlen($prefix) + 1), '\\', $this->nsSeparator).$this->fileExtension; |
|
| 155 | 155 | |
| 156 | 156 | if (is_file($filename)) { |
| 157 | 157 | return true; |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | $classes = []; |
| 174 | 174 | |
| 175 | 175 | foreach ($this->paths as $path) { |
| 176 | - if (! is_dir($path)) { |
|
| 176 | + if (!is_dir($path)) { |
|
| 177 | 177 | throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path); |
| 178 | 178 | } |
| 179 | 179 | |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | '\\' |
| 199 | 199 | ); |
| 200 | 200 | |
| 201 | - $classes[] = $this->prefixes[$path] . str_replace(DIRECTORY_SEPARATOR, '\\', $nsSuffix) . '\\' . str_replace($this->nsSeparator, '\\', $fileName); |
|
| 201 | + $classes[] = $this->prefixes[$path].str_replace(DIRECTORY_SEPARATOR, '\\', $nsSuffix).'\\'.str_replace($this->nsSeparator, '\\', $fileName); |
|
| 202 | 202 | } else { |
| 203 | 203 | /** @var string $className */ |
| 204 | 204 | $className = str_replace($this->nsSeparator, '\\', $fileName); |
@@ -216,11 +216,11 @@ discard block |
||
| 216 | 216 | */ |
| 217 | 217 | public function findMappingFile(string $className) |
| 218 | 218 | { |
| 219 | - $defaultFileName = str_replace('\\', $this->nsSeparator, $className) . $this->fileExtension; |
|
| 219 | + $defaultFileName = str_replace('\\', $this->nsSeparator, $className).$this->fileExtension; |
|
| 220 | 220 | foreach ($this->paths as $path) { |
| 221 | - if (! isset($this->prefixes[$path])) { |
|
| 222 | - if (is_file($path . DIRECTORY_SEPARATOR . $defaultFileName)) { |
|
| 223 | - return $path . DIRECTORY_SEPARATOR . $defaultFileName; |
|
| 221 | + if (!isset($this->prefixes[$path])) { |
|
| 222 | + if (is_file($path.DIRECTORY_SEPARATOR.$defaultFileName)) { |
|
| 223 | + return $path.DIRECTORY_SEPARATOR.$defaultFileName; |
|
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 | continue; |
@@ -228,11 +228,11 @@ discard block |
||
| 228 | 228 | |
| 229 | 229 | $prefix = $this->prefixes[$path]; |
| 230 | 230 | |
| 231 | - if (strpos($className, $prefix . '\\') !== 0) { |
|
| 231 | + if (strpos($className, $prefix.'\\') !== 0) { |
|
| 232 | 232 | continue; |
| 233 | 233 | } |
| 234 | 234 | |
| 235 | - $filename = $path . '/' . strtr(substr($className, strlen($prefix) + 1), '\\', $this->nsSeparator) . $this->fileExtension; |
|
| 235 | + $filename = $path.'/'.strtr(substr($className, strlen($prefix) + 1), '\\', $this->nsSeparator).$this->fileExtension; |
|
| 236 | 236 | if (is_file($filename)) { |
| 237 | 237 | return $filename; |
| 238 | 238 | } |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | |
| 244 | 244 | throw MappingException::mappingFileNotFound( |
| 245 | 245 | $className, |
| 246 | - substr($className, $pos + 1) . $this->fileExtension |
|
| 246 | + substr($className, $pos + 1).$this->fileExtension |
|
| 247 | 247 | ); |
| 248 | 248 | } |
| 249 | 249 | |
@@ -102,12 +102,12 @@ discard block |
||
| 102 | 102 | */ |
| 103 | 103 | public function findMappingFile(string $className) |
| 104 | 104 | { |
| 105 | - $fileName = str_replace('\\', '.', $className) . $this->fileExtension; |
|
| 105 | + $fileName = str_replace('\\', '.', $className).$this->fileExtension; |
|
| 106 | 106 | |
| 107 | 107 | // Check whether file exists |
| 108 | 108 | foreach ($this->paths as $path) { |
| 109 | - if (is_file($path . DIRECTORY_SEPARATOR . $fileName)) { |
|
| 110 | - return $path . DIRECTORY_SEPARATOR . $fileName; |
|
| 109 | + if (is_file($path.DIRECTORY_SEPARATOR.$fileName)) { |
|
| 110 | + return $path.DIRECTORY_SEPARATOR.$fileName; |
|
| 111 | 111 | } |
| 112 | 112 | } |
| 113 | 113 | |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | $classes = []; |
| 127 | 127 | |
| 128 | 128 | foreach ($this->paths as $path) { |
| 129 | - if (! is_dir($path)) { |
|
| 129 | + if (!is_dir($path)) { |
|
| 130 | 130 | throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path); |
| 131 | 131 | } |
| 132 | 132 | |
@@ -159,11 +159,11 @@ discard block |
||
| 159 | 159 | */ |
| 160 | 160 | public function fileExists(string $className) |
| 161 | 161 | { |
| 162 | - $fileName = str_replace('\\', '.', $className) . $this->fileExtension; |
|
| 162 | + $fileName = str_replace('\\', '.', $className).$this->fileExtension; |
|
| 163 | 163 | |
| 164 | 164 | // Check whether file exists |
| 165 | 165 | foreach ($this->paths as $path) { |
| 166 | - if (is_file($path . DIRECTORY_SEPARATOR . $fileName)) { |
|
| 166 | + if (is_file($path.DIRECTORY_SEPARATOR.$fileName)) { |
|
| 167 | 167 | return true; |
| 168 | 168 | } |
| 169 | 169 | } |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | */ |
| 23 | 23 | public function getParentClasses(string $class) |
| 24 | 24 | { |
| 25 | - if (! class_exists($class)) { |
|
| 25 | + if (!class_exists($class)) { |
|
| 26 | 26 | throw MappingException::nonExistingClass($class); |
| 27 | 27 | } |
| 28 | 28 | |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | public static function pathRequired() |
| 36 | 36 | { |
| 37 | - return new self('Specifying the paths to your entities is required ' . |
|
| 37 | + return new self('Specifying the paths to your entities is required '. |
|
| 38 | 38 | 'in the AnnotationDriver to retrieve all class names.'); |
| 39 | 39 | } |
| 40 | 40 | |
@@ -45,11 +45,11 @@ discard block |
||
| 45 | 45 | ?string $path = null |
| 46 | 46 | ) { |
| 47 | 47 | if ($path !== null) { |
| 48 | - $path = '[' . $path . ']'; |
|
| 48 | + $path = '['.$path.']'; |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | return new self(sprintf( |
| 52 | - 'File mapping drivers must have a valid directory path, ' . |
|
| 52 | + 'File mapping drivers must have a valid directory path, '. |
|
| 53 | 53 | 'however the given path %s seems to be incorrect!', |
| 54 | 54 | $path |
| 55 | 55 | )); |