@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | |
| 36 | 36 | protected function getFqcnFromAlias(string $namespaceAlias, string $simpleClassName) : string |
| 37 | 37 | { |
| 38 | - return __NAMESPACE__ . '\\' . $simpleClassName; |
|
| 38 | + return __NAMESPACE__.'\\'.$simpleClassName; |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | protected function initialize() : void |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | |
| 68 | 68 | protected function onNotFoundMetadata(string $className) : ?ClassMetadata |
| 69 | 69 | { |
| 70 | - if (! $this->fallbackCallback) { |
|
| 70 | + if (!$this->fallbackCallback) { |
|
| 71 | 71 | return null; |
| 72 | 72 | } |
| 73 | 73 | |
@@ -127,12 +127,12 @@ discard block |
||
| 127 | 127 | */ |
| 128 | 128 | public function fileExists(string $className) : bool |
| 129 | 129 | { |
| 130 | - $defaultFileName = str_replace('\\', $this->nsSeparator, $className) . $this->fileExtension; |
|
| 130 | + $defaultFileName = str_replace('\\', $this->nsSeparator, $className).$this->fileExtension; |
|
| 131 | 131 | |
| 132 | 132 | foreach ($this->paths as $path) { |
| 133 | - if (! isset($this->prefixes[$path])) { |
|
| 133 | + if (!isset($this->prefixes[$path])) { |
|
| 134 | 134 | // global namespace class |
| 135 | - if (is_file($path . DIRECTORY_SEPARATOR . $defaultFileName)) { |
|
| 135 | + if (is_file($path.DIRECTORY_SEPARATOR.$defaultFileName)) { |
|
| 136 | 136 | return true; |
| 137 | 137 | } |
| 138 | 138 | |
@@ -141,11 +141,11 @@ discard block |
||
| 141 | 141 | |
| 142 | 142 | $prefix = $this->prefixes[$path]; |
| 143 | 143 | |
| 144 | - if (strpos($className, $prefix . '\\') !== 0) { |
|
| 144 | + if (strpos($className, $prefix.'\\') !== 0) { |
|
| 145 | 145 | continue; |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | - $filename = $path . '/' . strtr(substr($className, strlen($prefix) + 1), '\\', $this->nsSeparator) . $this->fileExtension; |
|
| 148 | + $filename = $path.'/'.strtr(substr($className, strlen($prefix) + 1), '\\', $this->nsSeparator).$this->fileExtension; |
|
| 149 | 149 | |
| 150 | 150 | if (is_file($filename)) { |
| 151 | 151 | return true; |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | |
| 165 | 165 | if ($this->paths) { |
| 166 | 166 | foreach ((array) $this->paths as $path) { |
| 167 | - if (! is_dir($path)) { |
|
| 167 | + if (!is_dir($path)) { |
|
| 168 | 168 | throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path); |
| 169 | 169 | } |
| 170 | 170 | |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | '\\' |
| 190 | 190 | ); |
| 191 | 191 | |
| 192 | - $classes[] = $this->prefixes[$path] . str_replace(DIRECTORY_SEPARATOR, '\\', $nsSuffix) . '\\' . str_replace($this->nsSeparator, '\\', $fileName); |
|
| 192 | + $classes[] = $this->prefixes[$path].str_replace(DIRECTORY_SEPARATOR, '\\', $nsSuffix).'\\'.str_replace($this->nsSeparator, '\\', $fileName); |
|
| 193 | 193 | } else { |
| 194 | 194 | /** @var string $className */ |
| 195 | 195 | $className = str_replace($this->nsSeparator, '\\', $fileName); |
@@ -208,11 +208,11 @@ discard block |
||
| 208 | 208 | */ |
| 209 | 209 | public function findMappingFile(string $className) : string |
| 210 | 210 | { |
| 211 | - $defaultFileName = str_replace('\\', $this->nsSeparator, $className) . $this->fileExtension; |
|
| 211 | + $defaultFileName = str_replace('\\', $this->nsSeparator, $className).$this->fileExtension; |
|
| 212 | 212 | foreach ($this->paths as $path) { |
| 213 | - if (! isset($this->prefixes[$path])) { |
|
| 214 | - if (is_file($path . DIRECTORY_SEPARATOR . $defaultFileName)) { |
|
| 215 | - return $path . DIRECTORY_SEPARATOR . $defaultFileName; |
|
| 213 | + if (!isset($this->prefixes[$path])) { |
|
| 214 | + if (is_file($path.DIRECTORY_SEPARATOR.$defaultFileName)) { |
|
| 215 | + return $path.DIRECTORY_SEPARATOR.$defaultFileName; |
|
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | continue; |
@@ -220,11 +220,11 @@ discard block |
||
| 220 | 220 | |
| 221 | 221 | $prefix = $this->prefixes[$path]; |
| 222 | 222 | |
| 223 | - if (strpos($className, $prefix . '\\') !== 0) { |
|
| 223 | + if (strpos($className, $prefix.'\\') !== 0) { |
|
| 224 | 224 | continue; |
| 225 | 225 | } |
| 226 | 226 | |
| 227 | - $filename = $path . '/' . strtr(substr($className, strlen($prefix) + 1), '\\', $this->nsSeparator) . $this->fileExtension; |
|
| 227 | + $filename = $path.'/'.strtr(substr($className, strlen($prefix) + 1), '\\', $this->nsSeparator).$this->fileExtension; |
|
| 228 | 228 | if (is_file($filename)) { |
| 229 | 229 | return $filename; |
| 230 | 230 | } |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | |
| 233 | 233 | throw MappingException::mappingFileNotFound( |
| 234 | 234 | $className, |
| 235 | - substr($className, strrpos($className, '\\') + 1) . $this->fileExtension |
|
| 235 | + substr($className, strrpos($className, '\\') + 1).$this->fileExtension |
|
| 236 | 236 | ); |
| 237 | 237 | } |
| 238 | 238 | |
@@ -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 | |