@@ -312,6 +312,9 @@ |
||
| 312 | 312 | return new ReflectionExtension($extName); |
| 313 | 313 | } |
| 314 | 314 | |
| 315 | + /** |
|
| 316 | + * @return string |
|
| 317 | + */ |
|
| 315 | 318 | public function getExtensionName() |
| 316 | 319 | { |
| 317 | 320 | if (!$this->classLikeNode) { |
@@ -134,17 +134,17 @@ discard block |
||
| 134 | 134 | } |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | - $buildString = function (array $items, $indentLevel = 4) { |
|
| 137 | + $buildString = function(array $items, $indentLevel = 4) { |
|
| 138 | 138 | if (!count($items)) { |
| 139 | 139 | return ''; |
| 140 | 140 | } |
| 141 | - $indent = "\n" . str_repeat(' ', $indentLevel); |
|
| 142 | - return $indent . implode($indent, explode("\n", implode("\n", $items))); |
|
| 141 | + $indent = "\n".str_repeat(' ', $indentLevel); |
|
| 142 | + return $indent.implode($indent, explode("\n", implode("\n", $items))); |
|
| 143 | 143 | }; |
| 144 | - $buildConstants = function (array $items, $indentLevel = 4) { |
|
| 144 | + $buildConstants = function(array $items, $indentLevel = 4) { |
|
| 145 | 145 | $str = ''; |
| 146 | 146 | foreach ($items as $name => $value) { |
| 147 | - $str .= "\n" . str_repeat(' ', $indentLevel); |
|
| 147 | + $str .= "\n".str_repeat(' ', $indentLevel); |
|
| 148 | 148 | $str .= sprintf( |
| 149 | 149 | 'Constant [ %s %s ] { %s }', |
| 150 | 150 | gettype($value), |
@@ -168,8 +168,8 @@ discard block |
||
| 168 | 168 | ($isObject ? 'Object of class' : 'Class'), |
| 169 | 169 | $modifiers, |
| 170 | 170 | $this->getName(), |
| 171 | - false !== $parentClass ? (' extends ' . $parentClass->getName()) : '', |
|
| 172 | - $interfaceNames ? (' implements ' . implode(', ', $interfaceNames)) : '', |
|
| 171 | + false !== $parentClass ? (' extends '.$parentClass->getName()) : '', |
|
| 172 | + $interfaceNames ? (' implements '.implode(', ', $interfaceNames)) : '', |
|
| 173 | 173 | $this->getFileName(), |
| 174 | 174 | $this->getStartLine(), |
| 175 | 175 | $this->getEndLine(), |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | { |
| 211 | 211 | if (!isset($this->constants)) { |
| 212 | 212 | if ($this->classLikeNode) { |
| 213 | - $this->constants = $this->recursiveCollect(function (array &$result, \ReflectionClass $instance) { |
|
| 213 | + $this->constants = $this->recursiveCollect(function(array &$result, \ReflectionClass $instance) { |
|
| 214 | 214 | $result += $instance->getConstants(); |
| 215 | 215 | }); |
| 216 | 216 | $this->collectSelfConstants(); |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | $staticOrder = [true, false]; |
| 257 | 257 | foreach ($staticOrder as $shouldBeStatic) { |
| 258 | 258 | foreach ($properties as $property) { |
| 259 | - $isStaticProperty = $property->isStatic(); |
|
| 259 | + $isStaticProperty = $property->isStatic(); |
|
| 260 | 260 | if ($shouldBeStatic !== $isStaticProperty) { |
| 261 | 261 | continue; |
| 262 | 262 | } |
@@ -347,7 +347,7 @@ discard block |
||
| 347 | 347 | { |
| 348 | 348 | if (!isset($this->interfaceClasses)) { |
| 349 | 349 | if ($this->classLikeNode) { |
| 350 | - $this->interfaceClasses = $this->recursiveCollect(function (array &$result, \ReflectionClass $instance) { |
|
| 350 | + $this->interfaceClasses = $this->recursiveCollect(function(array &$result, \ReflectionClass $instance) { |
|
| 351 | 351 | if ($instance->isInterface()) { |
| 352 | 352 | $result[$instance->name] = $instance; |
| 353 | 353 | } |
@@ -394,7 +394,7 @@ discard block |
||
| 394 | 394 | if (!isset($this->methods)) { |
| 395 | 395 | if ($this->classLikeNode) { |
| 396 | 396 | $directMethods = ReflectionMethod::collectFromClassNode($this->classLikeNode, $this); |
| 397 | - $parentMethods = $this->recursiveCollect(function (array &$result, \ReflectionClass $instance, $isParent) { |
|
| 397 | + $parentMethods = $this->recursiveCollect(function(array &$result, \ReflectionClass $instance, $isParent) { |
|
| 398 | 398 | $reflectionMethods = []; |
| 399 | 399 | foreach ($instance->getMethods() as $reflectionMethod) { |
| 400 | 400 | if (!$isParent || !$reflectionMethod->isPrivate()) { |
@@ -479,9 +479,9 @@ discard block |
||
| 479 | 479 | */ |
| 480 | 480 | public function getName() |
| 481 | 481 | { |
| 482 | - $namespaceName = $this->namespaceName ? $this->namespaceName . '\\' : ''; |
|
| 482 | + $namespaceName = $this->namespaceName ? $this->namespaceName.'\\' : ''; |
|
| 483 | 483 | |
| 484 | - return $namespaceName . $this->getShortName(); |
|
| 484 | + return $namespaceName.$this->getShortName(); |
|
| 485 | 485 | } |
| 486 | 486 | |
| 487 | 487 | /** |
@@ -535,7 +535,7 @@ discard block |
||
| 535 | 535 | if (!isset($this->properties)) { |
| 536 | 536 | if ($this->classLikeNode) { |
| 537 | 537 | $directProperties = ReflectionProperty::collectFromClassNode($this->classLikeNode, $this->getName()); |
| 538 | - $parentProperties = $this->recursiveCollect(function (array &$result, \ReflectionClass $instance, $isParent) { |
|
| 538 | + $parentProperties = $this->recursiveCollect(function(array &$result, \ReflectionClass $instance, $isParent) { |
|
| 539 | 539 | $reflectionProperties = []; |
| 540 | 540 | foreach ($instance->getProperties() as $reflectionProperty) { |
| 541 | 541 | if (!$isParent || !$reflectionProperty->isPrivate()) { |
@@ -634,7 +634,7 @@ discard block |
||
| 634 | 634 | break; |
| 635 | 635 | } |
| 636 | 636 | } |
| 637 | - $aliases[$adaptation->newName] = $traitName . '::'. $methodName; |
|
| 637 | + $aliases[$adaptation->newName] = $traitName.'::'.$methodName; |
|
| 638 | 638 | } |
| 639 | 639 | } |
| 640 | 640 | |
@@ -106,6 +106,9 @@ discard block |
||
| 106 | 106 | return new ReflectionExtension($extName); |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | + /** |
|
| 110 | + * @return string |
|
| 111 | + */ |
|
| 109 | 112 | public function getExtensionName() |
| 110 | 113 | { |
| 111 | 114 | if (!$this->functionLikeNode) { |
@@ -223,7 +226,7 @@ discard block |
||
| 223 | 226 | /** |
| 224 | 227 | * Gets the specified return type of a function |
| 225 | 228 | * |
| 226 | - * @return \ReflectionType |
|
| 229 | + * @return null|ReflectionType |
|
| 227 | 230 | * |
| 228 | 231 | * @link http://php.net/manual/en/reflectionfunctionabstract.getreturntype.php |
| 229 | 232 | */ |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | if ($this->functionLikeNode instanceof Function_ || $this->functionLikeNode instanceof ClassMethod) { |
| 139 | 139 | $functionName = $this->functionLikeNode->name; |
| 140 | 140 | |
| 141 | - return $this->namespaceName ? $this->namespaceName . '\\' . $functionName : $functionName; |
|
| 141 | + return $this->namespaceName ? $this->namespaceName.'\\'.$functionName : $functionName; |
|
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | return false; |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | */ |
| 230 | 230 | public function getReturnType() |
| 231 | 231 | { |
| 232 | - $isBuiltin = false; |
|
| 232 | + $isBuiltin = false; |
|
| 233 | 233 | if ($this->functionLikeNode) { |
| 234 | 234 | $returnType = $this->functionLikeNode->getReturnType(); |
| 235 | 235 | $isNullable = $returnType instanceof NullableType; |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | } |
| 256 | 256 | $isNullable = $nativeType->allowsNull(); |
| 257 | 257 | $isBuiltin = $nativeType->isBuiltin(); |
| 258 | - $returnType = (string)$nativeType; |
|
| 258 | + $returnType = (string) $nativeType; |
|
| 259 | 259 | } |
| 260 | 260 | |
| 261 | 261 | return new ReflectionType($returnType, $isNullable, $isBuiltin); |
@@ -482,9 +482,9 @@ discard block |
||
| 482 | 482 | } |
| 483 | 483 | if (method_exists($orig, 'hasType') && $orig->hasType()) { |
| 484 | 484 | $typeRef = $orig->getType(); |
| 485 | - $stringType = ltrim((string)$typeRef, '?'); // ltrim() is precautionary. |
|
| 485 | + $stringType = ltrim((string) $typeRef, '?'); // ltrim() is precautionary. |
|
| 486 | 486 | if (PHP_VERSION_ID >= 70100 && $typeRef->allowsNull()) { |
| 487 | - $stringType = '?' . $stringType; |
|
| 487 | + $stringType = '?'.$stringType; |
|
| 488 | 488 | $nullableImplied = true; |
| 489 | 489 | } |
| 490 | 490 | $builder->setTypeHint($stringType); |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | protected function resolveScalarMagicConstMethod() |
| 142 | 142 | { |
| 143 | 143 | if ($this->context instanceof \ReflectionMethod) { |
| 144 | - $fullName = $this->context->getDeclaringClass()->name . '::' . $this->context->getShortName(); |
|
| 144 | + $fullName = $this->context->getDeclaringClass()->name.'::'.$this->context->getShortName(); |
|
| 145 | 145 | |
| 146 | 146 | return $fullName; |
| 147 | 147 | } |
@@ -228,13 +228,13 @@ discard block |
||
| 228 | 228 | |
| 229 | 229 | if (!$isFQNConstant) { |
| 230 | 230 | if (method_exists($this->context, 'getFileName')) { |
| 231 | - $fileName = $this->context->getFileName(); |
|
| 231 | + $fileName = $this->context->getFileName(); |
|
| 232 | 232 | if ($fileName !== false) { |
| 233 | 233 | $namespaceName = $this->resolveScalarMagicConstNamespace(); |
| 234 | 234 | $fileNamespace = new ReflectionFileNamespace($fileName, $namespaceName); |
| 235 | 235 | if ($fileNamespace->hasConstant($constantName)) { |
| 236 | 236 | $constantValue = $fileNamespace->getConstant($constantName); |
| 237 | - $constantName = $fileNamespace->getName() . '\\' . $constantName; |
|
| 237 | + $constantName = $fileNamespace->getName().'\\'.$constantName; |
|
| 238 | 238 | $isResolved = true; |
| 239 | 239 | } |
| 240 | 240 | } |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | $reason = 'Unable'; |
| 263 | 263 | if ($classToReflect instanceof Expr) { |
| 264 | 264 | $methodName = $this->getDispatchMethodFor($classToReflect); |
| 265 | - $reason = "Method " . __CLASS__ . "::{$methodName}() not found trying"; |
|
| 265 | + $reason = "Method ".__CLASS__."::{$methodName}() not found trying"; |
|
| 266 | 266 | } |
| 267 | 267 | throw new ReflectionException("$reason to resolve class constant."); |
| 268 | 268 | } |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | } |
| 280 | 280 | |
| 281 | 281 | $this->isConstant = true; |
| 282 | - $this->constantName = (string)$classToReflect . '::' . $constantName; |
|
| 282 | + $this->constantName = (string) $classToReflect.'::'.$constantName; |
|
| 283 | 283 | |
| 284 | 284 | return $refClass->getConstant($constantName); |
| 285 | 285 | } |
@@ -363,7 +363,7 @@ discard block |
||
| 363 | 363 | |
| 364 | 364 | protected function resolveExprBinaryOpConcat(Expr\BinaryOp\Concat $node) |
| 365 | 365 | { |
| 366 | - return $this->resolve($node->left) . $this->resolve($node->right); |
|
| 366 | + return $this->resolve($node->left).$this->resolve($node->right); |
|
| 367 | 367 | } |
| 368 | 368 | |
| 369 | 369 | protected function resolveExprTernary(Expr\Ternary $node) |
@@ -447,7 +447,7 @@ discard block |
||
| 447 | 447 | private function getDispatchMethodFor(Node $node) |
| 448 | 448 | { |
| 449 | 449 | $nodeType = $node->getType(); |
| 450 | - return 'resolve' . str_replace('_', '', $nodeType); |
|
| 450 | + return 'resolve'.str_replace('_', '', $nodeType); |
|
| 451 | 451 | } |
| 452 | 452 | |
| 453 | 453 | /** |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | 'int' => 'integer', |
| 86 | 86 | 'bool' => 'boolean' |
| 87 | 87 | ]; |
| 88 | - $displayType = (string)$type; |
|
| 88 | + $displayType = (string) $type; |
|
| 89 | 89 | if (isset($typeMap[$displayType])) { |
| 90 | 90 | $displayType = $typeMap[$displayType]; |
| 91 | 91 | } |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | public function wasIncluded() |
| 109 | 109 | { |
| 110 | 110 | return |
| 111 | - $this->isBuiltin() || |
|
| 111 | + $this->isBuiltin() || |
|
| 112 | 112 | interface_exists($this->type, false) || |
| 113 | 113 | trait_exists($this->type, false) || |
| 114 | 114 | class_exists($this->type, false); |
@@ -222,7 +222,7 @@ |
||
| 222 | 222 | |
| 223 | 223 | /** |
| 224 | 224 | * {@inheritDoc} |
| 225 | - * @return ReflectionClass|null The class of the method that declared the |
|
| 225 | + * @return \ReflectionClass|null The class of the method that declared the |
|
| 226 | 226 | * parameter, if any. |
| 227 | 227 | */ |
| 228 | 228 | public function getDeclaringClass() |
@@ -138,11 +138,11 @@ discard block |
||
| 138 | 138 | if ($hasDefaultValue) { |
| 139 | 139 | $defaultValue = $this->getDefaultValue(); |
| 140 | 140 | if (is_string($defaultValue) && strlen($defaultValue) > 15) { |
| 141 | - $defaultValue = substr($defaultValue, 0, 15) . '...'; |
|
| 141 | + $defaultValue = substr($defaultValue, 0, 15).'...'; |
|
| 142 | 142 | } |
| 143 | 143 | /* @see https://3v4l.org/DJOEb for behaviour changes */ |
| 144 | 144 | if (is_double($defaultValue) && fmod($defaultValue, 1.0) === 0.0) { |
| 145 | - $defaultValue = (int)$defaultValue; |
|
| 145 | + $defaultValue = (int) $defaultValue; |
|
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | $defaultValue = str_replace('\\\\', '\\', var_export($defaultValue, true)); |
@@ -152,11 +152,11 @@ discard block |
||
| 152 | 152 | 'Parameter #%d [ %s %s%s%s$%s%s ]', |
| 153 | 153 | $this->parameterIndex, |
| 154 | 154 | $isOptional ? '<optional>' : '<required>', |
| 155 | - $parameterType ? ReflectionType::convertToDisplayType($parameterType) . ' ' : '', |
|
| 155 | + $parameterType ? ReflectionType::convertToDisplayType($parameterType).' ' : '', |
|
| 156 | 156 | $this->isVariadic() ? '...' : '', |
| 157 | 157 | $this->isPassedByReference() ? '&' : '', |
| 158 | 158 | $this->getName(), |
| 159 | - ($isOptional && $hasDefaultValue) ? (' = ' . $defaultValue) : '' |
|
| 159 | + ($isOptional && $hasDefaultValue) ? (' = '.$defaultValue) : '' |
|
| 160 | 160 | ); |
| 161 | 161 | } |
| 162 | 162 | |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | |
| 216 | 216 | throw new ReflectionException("Can not resolve a class name for parameter"); |
| 217 | 217 | } |
| 218 | - $className = $parameterType->toString(); |
|
| 218 | + $className = $parameterType->toString(); |
|
| 219 | 219 | |
| 220 | 220 | return new ReflectionClass($className); |
| 221 | 221 | } |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | $origin = 'internal'; |
| 155 | 155 | $phpExt = $this->getExtension(); |
| 156 | 156 | if ($phpExt) { |
| 157 | - $origin .= ':' . $phpExt->getName(); |
|
| 157 | + $origin .= ':'.$phpExt->getName(); |
|
| 158 | 158 | } |
| 159 | 159 | } else { |
| 160 | 160 | $source = sprintf("\n @@ %s %d - %d", $this->getFileName(), $this->getStartLine(), $this->getEndLine()); |
@@ -172,15 +172,15 @@ discard block |
||
| 172 | 172 | |
| 173 | 173 | return sprintf( |
| 174 | 174 | $reflectionFormat, |
| 175 | - $this->getDocComment() ? $this->getDocComment() . "\n" : '', |
|
| 175 | + $this->getDocComment() ? $this->getDocComment()."\n" : '', |
|
| 176 | 176 | $origin, |
| 177 | 177 | $this->getName(), |
| 178 | 178 | $source, |
| 179 | 179 | count($this->getParameters()), |
| 180 | 180 | array_reduce( |
| 181 | 181 | $this->getParameters(), |
| 182 | - (function ($str, ReflectionParameter $param) { |
|
| 183 | - return $str . "\n " . $param; |
|
| 182 | + (function($str, ReflectionParameter $param) { |
|
| 183 | + return $str."\n ".$param; |
|
| 184 | 184 | }), |
| 185 | 185 | '' |
| 186 | 186 | ), |
@@ -189,6 +189,9 @@ discard block |
||
| 189 | 189 | $node->returnType = $this->fixType($node->returnType, self::RETURN_TYPES); |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | + /** |
|
| 193 | + * @param integer $contextType |
|
| 194 | + */ |
|
| 192 | 195 | private function fixType($node, $contextType) |
| 193 | 196 | { |
| 194 | 197 | $typeAsString = $this->getTypeAsString($node); |
@@ -232,6 +235,9 @@ discard block |
||
| 232 | 235 | return strval($node); |
| 233 | 236 | } |
| 234 | 237 | |
| 238 | + /** |
|
| 239 | + * @param string $typeName |
|
| 240 | + */ |
|
| 235 | 241 | private function isTypeDefinedForContext($typeName, $contextType) |
| 236 | 242 | { |
| 237 | 243 | return |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | } |
| 44 | 44 | $numericIndexCount = count(array_filter( |
| 45 | 45 | $options['supportedBuiltinTypeHints'], |
| 46 | - (function ($val) { |
|
| 46 | + (function($val) { |
|
| 47 | 47 | return preg_match('/^0*(0|[1-9]\\d*)$/', $val); |
| 48 | 48 | }), |
| 49 | 49 | ARRAY_FILTER_USE_KEY |
@@ -53,24 +53,24 @@ discard block |
||
| 53 | 53 | $typeHintName = $key; |
| 54 | 54 | $validFor = $value; |
| 55 | 55 | if (preg_match('/^0*(0|[1-9]\\d*)$/', $key) && |
| 56 | - (intval($key) >= 0) && |
|
| 57 | - (intval($key) < $numericIndexCount) |
|
| 56 | + (intval($key) >= 0) && |
|
| 57 | + (intval($key) < $numericIndexCount) |
|
| 58 | 58 | ) { |
| 59 | 59 | $numericIndex = true; |
| 60 | 60 | $typeHintName = $value; |
| 61 | - $validFor = self::PARAMETER_TYPES|self::RETURN_TYPES; |
|
| 61 | + $validFor = self::PARAMETER_TYPES | self::RETURN_TYPES; |
|
| 62 | 62 | } |
| 63 | 63 | if (!is_string($typeHintName) || !preg_match('/^\\w(?<!\\d)\\w*$/', $typeHintName)) { |
| 64 | 64 | throw new \InvalidArgumentException( |
| 65 | 65 | sprintf( |
| 66 | - "Option 'supportedBuiltinTypeHints's element %s " . |
|
| 66 | + "Option 'supportedBuiltinTypeHints's element %s ". |
|
| 67 | 67 | "isn't a valid typehint string.", |
| 68 | 68 | var_export($typeHintName, true) |
| 69 | 69 | ) |
| 70 | 70 | ); |
| 71 | - } elseif (!is_scalar($validFor) || |
|
| 72 | - (strval($validFor) != strval(intval($validFor))) || |
|
| 73 | - (intval($validFor) != (intval($validFor) & (self::PARAMETER_TYPES|self::RETURN_TYPES))) || |
|
| 71 | + } elseif (!is_scalar($validFor) || |
|
| 72 | + (strval($validFor) != strval(intval($validFor))) || |
|
| 73 | + (intval($validFor) != (intval($validFor) & (self::PARAMETER_TYPES | self::RETURN_TYPES))) || |
|
| 74 | 74 | (intval($validFor) == 0) |
| 75 | 75 | ) { |
| 76 | 76 | throw new \InvalidArgumentException( |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | ) |
| 89 | 89 | ); |
| 90 | 90 | } else { |
| 91 | - $this->supportedBuiltinTypeHints[$typeHintName] = intval($validFor) & (self::PARAMETER_TYPES|self::RETURN_TYPES); |
|
| 91 | + $this->supportedBuiltinTypeHints[$typeHintName] = intval($validFor) & (self::PARAMETER_TYPES | self::RETURN_TYPES); |
|
| 92 | 92 | } |
| 93 | 93 | } |
| 94 | 94 | } else { |
@@ -126,31 +126,31 @@ discard block |
||
| 126 | 126 | $builtInTypeNames = [ |
| 127 | 127 | 'array' => [ |
| 128 | 128 | 'introduced_version' => 50100, |
| 129 | - 'valid_for' => self::PARAMETER_TYPES|self::RETURN_TYPES, |
|
| 129 | + 'valid_for' => self::PARAMETER_TYPES | self::RETURN_TYPES, |
|
| 130 | 130 | ], |
| 131 | 131 | 'callable' => [ |
| 132 | 132 | 'introduced_version' => 50400, |
| 133 | - 'valid_for' => self::PARAMETER_TYPES|self::RETURN_TYPES, |
|
| 133 | + 'valid_for' => self::PARAMETER_TYPES | self::RETURN_TYPES, |
|
| 134 | 134 | ], |
| 135 | 135 | 'bool' => [ |
| 136 | 136 | 'introduced_version' => 70000, |
| 137 | - 'valid_for' => self::PARAMETER_TYPES|self::RETURN_TYPES, |
|
| 137 | + 'valid_for' => self::PARAMETER_TYPES | self::RETURN_TYPES, |
|
| 138 | 138 | ], |
| 139 | 139 | 'float' => [ |
| 140 | 140 | 'introduced_version' => 70000, |
| 141 | - 'valid_for' => self::PARAMETER_TYPES|self::RETURN_TYPES, |
|
| 141 | + 'valid_for' => self::PARAMETER_TYPES | self::RETURN_TYPES, |
|
| 142 | 142 | ], |
| 143 | 143 | 'int' => [ |
| 144 | 144 | 'introduced_version' => 70000, |
| 145 | - 'valid_for' => self::PARAMETER_TYPES|self::RETURN_TYPES, |
|
| 145 | + 'valid_for' => self::PARAMETER_TYPES | self::RETURN_TYPES, |
|
| 146 | 146 | ], |
| 147 | 147 | 'string' => [ |
| 148 | 148 | 'introduced_version' => 70000, |
| 149 | - 'valid_for' => self::PARAMETER_TYPES|self::RETURN_TYPES, |
|
| 149 | + 'valid_for' => self::PARAMETER_TYPES | self::RETURN_TYPES, |
|
| 150 | 150 | ], |
| 151 | 151 | 'iterable' => [ |
| 152 | 152 | 'introduced_version' => 70100, |
| 153 | - 'valid_for' => self::PARAMETER_TYPES|self::RETURN_TYPES, |
|
| 153 | + 'valid_for' => self::PARAMETER_TYPES | self::RETURN_TYPES, |
|
| 154 | 154 | ], |
| 155 | 155 | 'void' => [ |
| 156 | 156 | 'introduced_version' => 70100, |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | ], |
| 159 | 159 | 'object' => [ |
| 160 | 160 | 'introduced_version' => 70200, |
| 161 | - 'valid_for' => self::PARAMETER_TYPES|self::RETURN_TYPES, |
|
| 161 | + 'valid_for' => self::PARAMETER_TYPES | self::RETURN_TYPES, |
|
| 162 | 162 | ], |
| 163 | 163 | ]; |
| 164 | 164 | foreach ($builtInTypeNames as $typeHintName => $valid) { |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | public function enterNode(Node $node) |
| 173 | 173 | { |
| 174 | 174 | if ( |
| 175 | - ($node instanceof Stmt\Function_) || |
|
| 175 | + ($node instanceof Stmt\Function_) || |
|
| 176 | 176 | ($node instanceof Stmt\ClassMethod) || |
| 177 | 177 | ($node instanceof Expr\Closure) |
| 178 | 178 | ) { |
@@ -224,10 +224,10 @@ discard block |
||
| 224 | 224 | } |
| 225 | 225 | if ($node instanceof Node\NullableType) { |
| 226 | 226 | // This *SHOULD* never be called, but correct behavior shorter than Exception. |
| 227 | - return '?' . $this->getTypeAsString($node->type); |
|
| 227 | + return '?'.$this->getTypeAsString($node->type); |
|
| 228 | 228 | } |
| 229 | 229 | if ($node instanceof Name) { |
| 230 | - return ($node->isFullyQualified() ? '\\' : '') . $node->toString(); |
|
| 230 | + return ($node->isFullyQualified() ? '\\' : '').$node->toString(); |
|
| 231 | 231 | } |
| 232 | 232 | return strval($node); |
| 233 | 233 | } |