@@ -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 |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | $metadata = $this->createMock(ClassMetadata::class); |
| 18 | 18 | $metadata->expects(self::once())->method('getFieldNames'); |
| 19 | 19 | |
| 20 | - $driver = new PHPDriver([__DIR__ . '/_files']); |
|
| 20 | + $driver = new PHPDriver([__DIR__.'/_files']); |
|
| 21 | 21 | $driver->loadMetadataForClass('TestEntity', $metadata); |
| 22 | 22 | } |
| 23 | 23 | } |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | $locator->expects(self::once()) |
| 41 | 41 | ->method('findMappingFile') |
| 42 | 42 | ->with(self::equalTo('stdClass')) |
| 43 | - ->will(self::returnValue(__DIR__ . '/_files/stdClass.yml')); |
|
| 43 | + ->will(self::returnValue(__DIR__.'/_files/stdClass.yml')); |
|
| 44 | 44 | |
| 45 | 45 | $driver = $this->createTestFileDriver($locator); |
| 46 | 46 | |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | $locator->expects(self::once()) |
| 56 | 56 | ->method('findMappingFile') |
| 57 | 57 | ->with(self::equalTo('stdClass')) |
| 58 | - ->will(self::returnValue(__DIR__ . '/_files/stdClass.yml')); |
|
| 58 | + ->will(self::returnValue(__DIR__.'/_files/stdClass.yml')); |
|
| 59 | 59 | |
| 60 | 60 | $driver = $this->createTestFileDriver($locator); |
| 61 | 61 | |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | |
| 139 | 139 | public function testNonLocatorFallback() : void |
| 140 | 140 | { |
| 141 | - $driver = $this->createTestFileDriver(__DIR__ . '/_files', '.yml'); |
|
| 141 | + $driver = $this->createTestFileDriver(__DIR__.'/_files', '.yml'); |
|
| 142 | 142 | self::assertTrue($driver->isTransient('stdClass2')); |
| 143 | 143 | self::assertFalse($driver->isTransient('stdClass')); |
| 144 | 144 | } |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | { |
| 151 | 151 | $locator = $this->createMock(FileLocator::class); |
| 152 | 152 | $locator->expects(self::any())->method('getFileExtension')->will(self::returnValue('.yml')); |
| 153 | - $locator->expects(self::any())->method('getPaths')->will(self::returnValue([__DIR__ . '/_files'])); |
|
| 153 | + $locator->expects(self::any())->method('getPaths')->will(self::returnValue([__DIR__.'/_files'])); |
|
| 154 | 154 | |
| 155 | 155 | return $locator; |
| 156 | 156 | } |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | |
| 30 | 30 | public static function pathRequired() : self |
| 31 | 31 | { |
| 32 | - return new self('Specifying the paths to your entities is required ' . |
|
| 32 | + return new self('Specifying the paths to your entities is required '. |
|
| 33 | 33 | 'in the AnnotationDriver to retrieve all class names.'); |
| 34 | 34 | } |
| 35 | 35 | |
@@ -37,11 +37,11 @@ discard block |
||
| 37 | 37 | ?string $path = null |
| 38 | 38 | ) : self { |
| 39 | 39 | if ($path !== null) { |
| 40 | - $path = '[' . $path . ']'; |
|
| 40 | + $path = '['.$path.']'; |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | return new self(sprintf( |
| 44 | - 'File mapping drivers must have a valid directory path, ' . |
|
| 44 | + 'File mapping drivers must have a valid directory path, '. |
|
| 45 | 45 | 'however the given path %s seems to be incorrect!', |
| 46 | 46 | $path |
| 47 | 47 | )); |
@@ -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) : bool |
| 128 | 128 | { |
| 129 | - return ! method_exists($className, 'loadMetadata'); |
|
| 129 | + return !method_exists($className, 'loadMetadata'); |
|
| 130 | 130 | } |
| 131 | 131 | } |
@@ -129,12 +129,12 @@ discard block |
||
| 129 | 129 | */ |
| 130 | 130 | public function fileExists(string $className) : bool |
| 131 | 131 | { |
| 132 | - $defaultFileName = str_replace('\\', $this->nsSeparator, $className) . $this->fileExtension; |
|
| 132 | + $defaultFileName = str_replace('\\', $this->nsSeparator, $className).$this->fileExtension; |
|
| 133 | 133 | |
| 134 | 134 | foreach ($this->paths as $path) { |
| 135 | - if (! isset($this->prefixes[$path])) { |
|
| 135 | + if (!isset($this->prefixes[$path])) { |
|
| 136 | 136 | // global namespace class |
| 137 | - if (is_file($path . DIRECTORY_SEPARATOR . $defaultFileName)) { |
|
| 137 | + if (is_file($path.DIRECTORY_SEPARATOR.$defaultFileName)) { |
|
| 138 | 138 | return true; |
| 139 | 139 | } |
| 140 | 140 | |
@@ -143,11 +143,11 @@ discard block |
||
| 143 | 143 | |
| 144 | 144 | $prefix = $this->prefixes[$path]; |
| 145 | 145 | |
| 146 | - if (strpos($className, $prefix . '\\') !== 0) { |
|
| 146 | + if (strpos($className, $prefix.'\\') !== 0) { |
|
| 147 | 147 | continue; |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | - $filename = $path . '/' . strtr(substr($className, strlen($prefix) + 1), '\\', $this->nsSeparator) . $this->fileExtension; |
|
| 150 | + $filename = $path.'/'.strtr(substr($className, strlen($prefix) + 1), '\\', $this->nsSeparator).$this->fileExtension; |
|
| 151 | 151 | |
| 152 | 152 | if (is_file($filename)) { |
| 153 | 153 | return true; |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | $classes = []; |
| 170 | 170 | |
| 171 | 171 | foreach ($this->paths as $path) { |
| 172 | - if (! is_dir($path)) { |
|
| 172 | + if (!is_dir($path)) { |
|
| 173 | 173 | throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path); |
| 174 | 174 | } |
| 175 | 175 | |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | '\\' |
| 195 | 195 | ); |
| 196 | 196 | |
| 197 | - $classes[] = $this->prefixes[$path] . str_replace(DIRECTORY_SEPARATOR, '\\', $nsSuffix) . '\\' . str_replace($this->nsSeparator, '\\', $fileName); |
|
| 197 | + $classes[] = $this->prefixes[$path].str_replace(DIRECTORY_SEPARATOR, '\\', $nsSuffix).'\\'.str_replace($this->nsSeparator, '\\', $fileName); |
|
| 198 | 198 | } else { |
| 199 | 199 | /** @var string $className */ |
| 200 | 200 | $className = str_replace($this->nsSeparator, '\\', $fileName); |
@@ -212,11 +212,11 @@ discard block |
||
| 212 | 212 | */ |
| 213 | 213 | public function findMappingFile(string $className) : string |
| 214 | 214 | { |
| 215 | - $defaultFileName = str_replace('\\', $this->nsSeparator, $className) . $this->fileExtension; |
|
| 215 | + $defaultFileName = str_replace('\\', $this->nsSeparator, $className).$this->fileExtension; |
|
| 216 | 216 | foreach ($this->paths as $path) { |
| 217 | - if (! isset($this->prefixes[$path])) { |
|
| 218 | - if (is_file($path . DIRECTORY_SEPARATOR . $defaultFileName)) { |
|
| 219 | - return $path . DIRECTORY_SEPARATOR . $defaultFileName; |
|
| 217 | + if (!isset($this->prefixes[$path])) { |
|
| 218 | + if (is_file($path.DIRECTORY_SEPARATOR.$defaultFileName)) { |
|
| 219 | + return $path.DIRECTORY_SEPARATOR.$defaultFileName; |
|
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | continue; |
@@ -224,11 +224,11 @@ discard block |
||
| 224 | 224 | |
| 225 | 225 | $prefix = $this->prefixes[$path]; |
| 226 | 226 | |
| 227 | - if (strpos($className, $prefix . '\\') !== 0) { |
|
| 227 | + if (strpos($className, $prefix.'\\') !== 0) { |
|
| 228 | 228 | continue; |
| 229 | 229 | } |
| 230 | 230 | |
| 231 | - $filename = $path . '/' . strtr(substr($className, strlen($prefix) + 1), '\\', $this->nsSeparator) . $this->fileExtension; |
|
| 231 | + $filename = $path.'/'.strtr(substr($className, strlen($prefix) + 1), '\\', $this->nsSeparator).$this->fileExtension; |
|
| 232 | 232 | if (is_file($filename)) { |
| 233 | 233 | return $filename; |
| 234 | 234 | } |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | |
| 240 | 240 | throw MappingException::mappingFileNotFound( |
| 241 | 241 | $className, |
| 242 | - substr($className, $pos + 1) . $this->fileExtension |
|
| 242 | + substr($className, $pos + 1).$this->fileExtension |
|
| 243 | 243 | ); |
| 244 | 244 | } |
| 245 | 245 | |
@@ -82,10 +82,10 @@ discard block |
||
| 82 | 82 | |
| 83 | 83 | $result = $this->loadMappingFile($this->locator->findMappingFile($className)); |
| 84 | 84 | |
| 85 | - if (! isset($result[$className])) { |
|
| 85 | + if (!isset($result[$className])) { |
|
| 86 | 86 | throw MappingException::invalidMappingFile( |
| 87 | 87 | $className, |
| 88 | - str_replace('\\', '.', $className) . $this->locator->getFileExtension() |
|
| 88 | + str_replace('\\', '.', $className).$this->locator->getFileExtension() |
|
| 89 | 89 | ); |
| 90 | 90 | } |
| 91 | 91 | |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | return false; |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | - return ! $this->locator->fileExists($className); |
|
| 110 | + return !$this->locator->fileExists($className); |
|
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | /** |
@@ -165,8 +165,8 @@ discard block |
||
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | foreach ($this->locator->getPaths() as $path) { |
| 168 | - $file = $path . '/' . $this->globalBasename . $this->locator->getFileExtension(); |
|
| 169 | - if (! is_file($file)) { |
|
| 168 | + $file = $path.'/'.$this->globalBasename.$this->locator->getFileExtension(); |
|
| 169 | + if (!is_file($file)) { |
|
| 170 | 170 | continue; |
| 171 | 171 | } |
| 172 | 172 | |
@@ -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 | |
@@ -94,12 +94,12 @@ discard block |
||
| 94 | 94 | */ |
| 95 | 95 | public function findMappingFile(string $className) : string |
| 96 | 96 | { |
| 97 | - $fileName = str_replace('\\', '.', $className) . $this->fileExtension; |
|
| 97 | + $fileName = str_replace('\\', '.', $className).$this->fileExtension; |
|
| 98 | 98 | |
| 99 | 99 | // Check whether file exists |
| 100 | 100 | foreach ($this->paths as $path) { |
| 101 | - if (is_file($path . DIRECTORY_SEPARATOR . $fileName)) { |
|
| 102 | - return $path . DIRECTORY_SEPARATOR . $fileName; |
|
| 101 | + if (is_file($path.DIRECTORY_SEPARATOR.$fileName)) { |
|
| 102 | + return $path.DIRECTORY_SEPARATOR.$fileName; |
|
| 103 | 103 | } |
| 104 | 104 | } |
| 105 | 105 | |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | $classes = []; |
| 119 | 119 | |
| 120 | 120 | foreach ($this->paths as $path) { |
| 121 | - if (! is_dir($path)) { |
|
| 121 | + if (!is_dir($path)) { |
|
| 122 | 122 | throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path); |
| 123 | 123 | } |
| 124 | 124 | |
@@ -151,11 +151,11 @@ discard block |
||
| 151 | 151 | */ |
| 152 | 152 | public function fileExists(string $className) : bool |
| 153 | 153 | { |
| 154 | - $fileName = str_replace('\\', '.', $className) . $this->fileExtension; |
|
| 154 | + $fileName = str_replace('\\', '.', $className).$this->fileExtension; |
|
| 155 | 155 | |
| 156 | 156 | // Check whether file exists |
| 157 | 157 | foreach ($this->paths as $path) { |
| 158 | - if (is_file($path . DIRECTORY_SEPARATOR . $fileName)) { |
|
| 158 | + if (is_file($path.DIRECTORY_SEPARATOR.$fileName)) { |
|
| 159 | 159 | return true; |
| 160 | 160 | } |
| 161 | 161 | } |