@@ -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 | )); |
@@ -94,7 +94,7 @@ |
||
| 94 | 94 | */ |
| 95 | 95 | private function assertValidField(string $field) |
| 96 | 96 | { |
| 97 | - if (! isset($this->entityChangeSet[$field])) { |
|
| 97 | + if (!isset($this->entityChangeSet[$field])) { |
|
| 98 | 98 | throw new InvalidArgumentException(sprintf( |
| 99 | 99 | 'Field "%s" is not a valid field of the entity "%s" in PreUpdateEventArgs.', |
| 100 | 100 | $field, |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | $name = $this->defaultConnection; |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | - if (! isset($this->connections[$name])) { |
|
| 97 | + if (!isset($this->connections[$name])) { |
|
| 98 | 98 | throw new InvalidArgumentException( |
| 99 | 99 | sprintf('Doctrine %s Connection named "%s" does not exist.', $this->name, $name) |
| 100 | 100 | ); |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | $name = $this->defaultManager; |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | - if (! isset($this->managers[$name])) { |
|
| 154 | + if (!isset($this->managers[$name])) { |
|
| 155 | 155 | throw new InvalidArgumentException( |
| 156 | 156 | sprintf('Doctrine %s Manager named "%s" does not exist.', $this->name, $name) |
| 157 | 157 | ); |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | if (strpos($class, ':') !== false) { |
| 170 | 170 | [$namespaceAlias, $simpleClassName] = explode(':', $class, 2); |
| 171 | 171 | |
| 172 | - $class = $this->getAliasNamespace($namespaceAlias) . '\\' . $simpleClassName; |
|
| 172 | + $class = $this->getAliasNamespace($namespaceAlias).'\\'.$simpleClassName; |
|
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | $proxyClass = new ReflectionClass($class); |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | foreach ($this->managers as $id) { |
| 188 | 188 | $manager = $this->getService($id); |
| 189 | 189 | |
| 190 | - if (! $manager->getMetadataFactory()->isTransient($class)) { |
|
| 190 | + if (!$manager->getMetadataFactory()->isTransient($class)) { |
|
| 191 | 191 | return $manager; |
| 192 | 192 | } |
| 193 | 193 | } |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | $name = $this->defaultManager; |
| 242 | 242 | } |
| 243 | 243 | |
| 244 | - if (! isset($this->managers[$name])) { |
|
| 244 | + if (!isset($this->managers[$name])) { |
|
| 245 | 245 | throw new InvalidArgumentException(sprintf('Doctrine %s Manager named "%s" does not exist.', $this->name, $name)); |
| 246 | 246 | } |
| 247 | 247 | |