@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | return $this->classNames; |
72 | 72 | } |
73 | 73 | |
74 | - if ( ! $this->paths) { |
|
74 | + if (!$this->paths) { |
|
75 | 75 | throw MappingException::pathRequired(); |
76 | 76 | } |
77 | 77 | |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | $includedFiles = []; |
80 | 80 | |
81 | 81 | foreach ($this->paths as $path) { |
82 | - if ( ! is_dir($path)) { |
|
82 | + if (!is_dir($path)) { |
|
83 | 83 | throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path); |
84 | 84 | } |
85 | 85 | |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | foreach ($declared as $className) { |
105 | 105 | $rc = new \ReflectionClass($className); |
106 | 106 | $sourceFile = $rc->getFileName(); |
107 | - if (in_array($sourceFile, $includedFiles) && ! $this->isTransient($className)) { |
|
107 | + if (in_array($sourceFile, $includedFiles) && !$this->isTransient($className)) { |
|
108 | 108 | $classes[] = $className; |
109 | 109 | } |
110 | 110 | } |
@@ -119,6 +119,6 @@ discard block |
||
119 | 119 | */ |
120 | 120 | public function isTransient($className) |
121 | 121 | { |
122 | - return ! method_exists($className, 'loadMetadata'); |
|
122 | + return !method_exists($className, 'loadMetadata'); |
|
123 | 123 | } |
124 | 124 | } |
@@ -95,8 +95,8 @@ discard block |
||
95 | 95 | } |
96 | 96 | |
97 | 97 | $result = $this->loadMappingFile($this->locator->findMappingFile($className)); |
98 | - if ( ! isset($result[$className])) { |
|
99 | - throw MappingException::invalidMappingFile($className, str_replace('\\', '.', $className) . $this->locator->getFileExtension()); |
|
98 | + if (!isset($result[$className])) { |
|
99 | + throw MappingException::invalidMappingFile($className, str_replace('\\', '.', $className).$this->locator->getFileExtension()); |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | $this->classCache[$className] = $result[$className]; |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | return false; |
118 | 118 | } |
119 | 119 | |
120 | - return ! $this->locator->fileExists($className); |
|
120 | + return !$this->locator->fileExists($className); |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | /** |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | $this->initialize(); |
130 | 130 | } |
131 | 131 | |
132 | - if ( ! $this->classCache) { |
|
132 | + if (!$this->classCache) { |
|
133 | 133 | return (array) $this->locator->getAllClassNames($this->globalBasename); |
134 | 134 | } |
135 | 135 | |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | $this->classCache = []; |
166 | 166 | if (null !== $this->globalBasename) { |
167 | 167 | foreach ($this->locator->getPaths() as $path) { |
168 | - $file = $path . '/' . $this->globalBasename . $this->locator->getFileExtension(); |
|
168 | + $file = $path.'/'.$this->globalBasename.$this->locator->getFileExtension(); |
|
169 | 169 | if (is_file($file)) { |
170 | 170 | $this->classCache = array_merge( |
171 | 171 | $this->classCache, |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | */ |
88 | 88 | public function getAllMetadata() |
89 | 89 | { |
90 | - if ( ! $this->initialized) { |
|
90 | + if (!$this->initialized) { |
|
91 | 91 | $this->initialize(); |
92 | 92 | } |
93 | 93 | |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | |
191 | 191 | try { |
192 | 192 | if ($this->cacheDriver) { |
193 | - $cached = $this->cacheDriver->fetch($realClassName . $this->cacheSalt); |
|
193 | + $cached = $this->cacheDriver->fetch($realClassName.$this->cacheSalt); |
|
194 | 194 | if ($cached instanceof ClassMetadata) { |
195 | 195 | $this->loadedMetadata[$realClassName] = $cached; |
196 | 196 | |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | } else { |
199 | 199 | foreach ($this->loadMetadata($realClassName) as $loadedClassName) { |
200 | 200 | $this->cacheDriver->save( |
201 | - $loadedClassName . $this->cacheSalt, |
|
201 | + $loadedClassName.$this->cacheSalt, |
|
202 | 202 | $this->loadedMetadata[$loadedClassName], |
203 | 203 | null |
204 | 204 | ); |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | $this->loadMetadata($realClassName); |
209 | 209 | } |
210 | 210 | } catch (MappingException $loadingException) { |
211 | - if ( ! $fallbackMetadataResponse = $this->onNotFoundMetadata($realClassName)) { |
|
211 | + if (!$fallbackMetadataResponse = $this->onNotFoundMetadata($realClassName)) { |
|
212 | 212 | throw $loadingException; |
213 | 213 | } |
214 | 214 | |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | // Collect parent classes, ignoring transient (not-mapped) classes. |
263 | 263 | $parentClasses = []; |
264 | 264 | foreach (array_reverse($this->getReflectionService()->getParentClasses($name)) as $parentClass) { |
265 | - if ( ! $this->getDriver()->isTransient($parentClass)) { |
|
265 | + if (!$this->getDriver()->isTransient($parentClass)) { |
|
266 | 266 | $parentClasses[] = $parentClass; |
267 | 267 | } |
268 | 268 | } |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | */ |
286 | 286 | protected function loadMetadata($name) |
287 | 287 | { |
288 | - if ( ! $this->initialized) { |
|
288 | + if (!$this->initialized) { |
|
289 | 289 | $this->initialize(); |
290 | 290 | } |
291 | 291 | |
@@ -372,7 +372,7 @@ discard block |
||
372 | 372 | */ |
373 | 373 | public function isTransient($class) |
374 | 374 | { |
375 | - if ( ! $this->initialized) { |
|
375 | + if (!$this->initialized) { |
|
376 | 376 | $this->initialize(); |
377 | 377 | } |
378 | 378 |
@@ -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 = isset($object->$name) ? $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; |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | */ |
22 | 22 | public static function getRealClass($class) |
23 | 23 | { |
24 | - if (false === $pos = strrpos($class, '\\' . Proxy::MARKER . '\\')) { |
|
24 | + if (false === $pos = strrpos($class, '\\'.Proxy::MARKER.'\\')) { |
|
25 | 25 | return $class; |
26 | 26 | } |
27 | 27 | |
@@ -86,6 +86,6 @@ discard block |
||
86 | 86 | */ |
87 | 87 | public static function generateProxyClassName($className, $proxyNamespace) |
88 | 88 | { |
89 | - return rtrim($proxyNamespace, '\\') . '\\' . Proxy::MARKER . '\\' . ltrim($className, '\\'); |
|
89 | + return rtrim($proxyNamespace, '\\').'\\'.Proxy::MARKER.'\\'.ltrim($className, '\\'); |
|
90 | 90 | } |
91 | 91 | } |
@@ -13,9 +13,9 @@ |
||
13 | 13 | return [ |
14 | 14 | [\stdClass::class, \stdClass::class], |
15 | 15 | [\Doctrine\Common\Util\ClassUtils::class, \Doctrine\Common\Util\ClassUtils::class], |
16 | - [ 'MyProject\Proxies\__CG__\stdClass', \stdClass::class], |
|
17 | - [ 'MyProject\Proxies\__CG__\OtherProject\Proxies\__CG__\stdClass', \stdClass::class], |
|
18 | - [ 'MyProject\Proxies\__CG__\Doctrine\Tests\Common\Util\ChildObject', ChildObject::class] |
|
16 | + ['MyProject\Proxies\__CG__\stdClass', \stdClass::class], |
|
17 | + ['MyProject\Proxies\__CG__\OtherProject\Proxies\__CG__\stdClass', \stdClass::class], |
|
18 | + ['MyProject\Proxies\__CG__\Doctrine\Tests\Common\Util\ChildObject', ChildObject::class] |
|
19 | 19 | ]; |
20 | 20 | } |
21 | 21 |