@@ -517,7 +517,7 @@ |
||
| 517 | 517 | |
| 518 | 518 | if (!$injector instanceof InjectorInterface) { |
| 519 | 519 | throw new InjectionException( |
| 520 | - "Class '" . get_class($injector) . "' must be an instance of InjectorInterface for '{$reflection->getName()}'" |
|
| 520 | + "Class '".get_class($injector)."' must be an instance of InjectorInterface for '{$reflection->getName()}'" |
|
| 521 | 521 | ); |
| 522 | 522 | } |
| 523 | 523 | |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | |
| 41 | 41 | $name = $context->getName(); |
| 42 | 42 | if ($context instanceof \ReflectionMethod) { |
| 43 | - $name = $context->class . '::' . $name; |
|
| 43 | + $name = $context->class.'::'.$name; |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | parent::__construct("Unable to resolve '{$parameter->name}' argument in '{$name}'"); |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | { |
| 236 | 236 | self::register(); |
| 237 | 237 | |
| 238 | - $uri = 'spiral://' . spl_object_hash($stream); |
|
| 238 | + $uri = 'spiral://'.spl_object_hash($stream); |
|
| 239 | 239 | self::$uris[$uri] = $stream; |
| 240 | 240 | |
| 241 | 241 | return $uri; |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | public static function releaseUri($uri) |
| 289 | 289 | { |
| 290 | 290 | if ($uri instanceof StreamInterface) { |
| 291 | - $uri = 'spiral://' . spl_object_hash($uri); |
|
| 291 | + $uri = 'spiral://'.spl_object_hash($uri); |
|
| 292 | 292 | } |
| 293 | 293 | |
| 294 | 294 | unset(self::$uris[$uri]); |
@@ -392,7 +392,7 @@ discard block |
||
| 392 | 392 | $path = str_replace(['//', '\\'], '/', $path); |
| 393 | 393 | |
| 394 | 394 | //Potentially open links and ../ type directories? |
| 395 | - return rtrim($path, '/') . ($asDirectory ? '/' : ''); |
|
| 395 | + return rtrim($path, '/').($asDirectory ? '/' : ''); |
|
| 396 | 396 | } |
| 397 | 397 | |
| 398 | 398 | /** |
@@ -423,7 +423,7 @@ discard block |
||
| 423 | 423 | $relative = array_pad($relative, $padLength, '..'); |
| 424 | 424 | break; |
| 425 | 425 | } else { |
| 426 | - $relative[0] = './' . $relative[0]; |
|
| 426 | + $relative[0] = './'.$relative[0]; |
|
| 427 | 427 | } |
| 428 | 428 | } |
| 429 | 429 | } |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | if ($this->isCloseTag($token)) { |
| 74 | 74 | $blockID = $this->uniqueID(); |
| 75 | 75 | |
| 76 | - $this->phpBlocks[$blockID] = $phpBlock . $token[1]; |
|
| 76 | + $this->phpBlocks[$blockID] = $phpBlock.$token[1]; |
|
| 77 | 77 | $isolated .= $this->placeholder($blockID); |
| 78 | 78 | |
| 79 | 79 | $phpBlock = ''; |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | { |
| 139 | 139 | return preg_replace_callback( |
| 140 | 140 | $this->blockRegex(), |
| 141 | - function ($match) use ($partial, $blockIDs) { |
|
| 141 | + function($match) use ($partial, $blockIDs) { |
|
| 142 | 142 | if ($partial && !in_array($match['id'], $blockIDs)) { |
| 143 | 143 | return $match[0]; |
| 144 | 144 | } |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | */ |
| 180 | 180 | private function blockRegex(): string |
| 181 | 181 | { |
| 182 | - return '/' . |
|
| 182 | + return '/'. |
|
| 183 | 183 | preg_quote($this->prefix) |
| 184 | 184 | . '(?P<id>[0-9a-z]+)' |
| 185 | 185 | . preg_quote($this->postfix) |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | */ |
| 192 | 192 | private function uniqueID(): string |
| 193 | 193 | { |
| 194 | - return md5(count($this->phpBlocks) . uniqid(true)); |
|
| 194 | + return md5(count($this->phpBlocks).uniqid(true)); |
|
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | /** |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | */ |
| 202 | 202 | private function placeholder(string $blockID): string |
| 203 | 203 | { |
| 204 | - return $this->prefix . $blockID . $this->postfix; |
|
| 204 | + return $this->prefix.$blockID.$this->postfix; |
|
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | /** |
@@ -88,7 +88,7 @@ |
||
| 88 | 88 | */ |
| 89 | 89 | protected function classReflection(string $class): \ReflectionClass |
| 90 | 90 | { |
| 91 | - $loader = function ($class) { |
|
| 91 | + $loader = function($class) { |
|
| 92 | 92 | throw new LocatorException("Class '{$class}' can not be loaded"); |
| 93 | 93 | }; |
| 94 | 94 | |
@@ -18,10 +18,10 @@ |
||
| 18 | 18 | /** |
| 19 | 19 | * Argument types. |
| 20 | 20 | */ |
| 21 | - const CONSTANT = 'constant'; //Scalar constant and not variable. |
|
| 22 | - const VARIABLE = 'variable'; //PHP variable |
|
| 21 | + const CONSTANT = 'constant'; //Scalar constant and not variable. |
|
| 22 | + const VARIABLE = 'variable'; //PHP variable |
|
| 23 | 23 | const EXPRESSION = 'expression'; //PHP code (expression). |
| 24 | - const STRING = 'string'; //Simple scalar string, can be fetched using stringValue(). |
|
| 24 | + const STRING = 'string'; //Simple scalar string, can be fetched using stringValue(). |
|
| 25 | 25 | |
| 26 | 26 | /** |
| 27 | 27 | * @var string |
@@ -420,7 +420,7 @@ discard block |
||
| 420 | 420 | |
| 421 | 421 | $name = $this->tokens[$localID][self::TOKEN_CODE]; |
| 422 | 422 | if (!empty($namespace = $this->activeNamespace($tokenID))) { |
| 423 | - $name = $namespace . self::NS_SEPARATOR . $name; |
|
| 423 | + $name = $namespace.self::NS_SEPARATOR.$name; |
|
| 424 | 424 | } |
| 425 | 425 | |
| 426 | 426 | $this->functions[$name] = [ |
@@ -445,7 +445,7 @@ discard block |
||
| 445 | 445 | |
| 446 | 446 | $name = $this->tokens[$localID][self::TOKEN_CODE]; |
| 447 | 447 | if (!empty($namespace = $this->activeNamespace($tokenID))) { |
| 448 | - $name = $namespace . self::NS_SEPARATOR . $name; |
|
| 448 | + $name = $namespace.self::NS_SEPARATOR.$name; |
|
| 449 | 449 | } |
| 450 | 450 | |
| 451 | 451 | $this->declarations[token_name($tokenType)][$name] = [ |
@@ -84,11 +84,11 @@ |
||
| 84 | 84 | $reflection = new ReflectionFile( |
| 85 | 85 | $filename, |
| 86 | 86 | $this->normalizeTokens(token_get_all($this->files->read($filename))), |
| 87 | - (array)$this->memory->loadData(self::MEMORY . '.' . $fileMD5) |
|
| 87 | + (array)$this->memory->loadData(self::MEMORY.'.'.$fileMD5) |
|
| 88 | 88 | ); |
| 89 | 89 | |
| 90 | 90 | //Let's save to cache |
| 91 | - $this->memory->saveData(self::MEMORY . '.' . $fileMD5, $reflection->exportSchema()); |
|
| 91 | + $this->memory->saveData(self::MEMORY.'.'.$fileMD5, $reflection->exportSchema()); |
|
| 92 | 92 | |
| 93 | 93 | return $reflection; |
| 94 | 94 | } |