@@ -351,7 +351,7 @@ |
||
351 | 351 | { |
352 | 352 | return |
353 | 353 | interface_exists($this->className, false) || |
354 | - trait_exists($this->className, false) || |
|
355 | - class_exists($this->className, false); |
|
354 | + trait_exists($this->className, false) || |
|
355 | + class_exists($this->className, false); |
|
356 | 356 | } |
357 | 357 | } |
@@ -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()) { |
@@ -477,9 +477,9 @@ discard block |
||
477 | 477 | */ |
478 | 478 | public function getName() |
479 | 479 | { |
480 | - $namespaceName = $this->namespaceName ? $this->namespaceName . '\\' : ''; |
|
480 | + $namespaceName = $this->namespaceName ? $this->namespaceName.'\\' : ''; |
|
481 | 481 | |
482 | - return $namespaceName . $this->getShortName(); |
|
482 | + return $namespaceName.$this->getShortName(); |
|
483 | 483 | } |
484 | 484 | |
485 | 485 | /** |
@@ -533,7 +533,7 @@ discard block |
||
533 | 533 | if (!isset($this->properties)) { |
534 | 534 | if ($this->classLikeNode) { |
535 | 535 | $directProperties = ReflectionProperty::collectFromClassNode($this->classLikeNode, $this->getName()); |
536 | - $parentProperties = $this->recursiveCollect(function (array &$result, \ReflectionClass $instance, $isParent) { |
|
536 | + $parentProperties = $this->recursiveCollect(function(array &$result, \ReflectionClass $instance, $isParent) { |
|
537 | 537 | $reflectionProperties = []; |
538 | 538 | foreach ($instance->getProperties() as $reflectionProperty) { |
539 | 539 | if (!$isParent || !$reflectionProperty->isPrivate()) { |
@@ -630,7 +630,7 @@ discard block |
||
630 | 630 | break; |
631 | 631 | } |
632 | 632 | } |
633 | - $aliases[$adaptation->newName] = $traitName . '::'. $methodName; |
|
633 | + $aliases[$adaptation->newName] = $traitName.'::'.$methodName; |
|
634 | 634 | } |
635 | 635 | } |
636 | 636 | |
@@ -1090,7 +1090,7 @@ discard block |
||
1090 | 1090 | { |
1091 | 1091 | return |
1092 | 1092 | interface_exists($this->getName(), false) || |
1093 | - trait_exists($this->getName(), false) || |
|
1094 | - class_exists($this->getName(), false); |
|
1093 | + trait_exists($this->getName(), false) || |
|
1094 | + class_exists($this->getName(), false); |
|
1095 | 1095 | } |
1096 | 1096 | } |
@@ -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); |
@@ -133,12 +133,12 @@ discard block |
||
133 | 133 | $paramString = ''; |
134 | 134 | $identation = str_repeat(' ', 4); |
135 | 135 | foreach ($methodParameters as $methodParameter) { |
136 | - $paramString .= "\n{$identation}" . $methodParameter; |
|
136 | + $paramString .= "\n{$identation}".$methodParameter; |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | return sprintf( |
140 | 140 | "%sMethod [ <user%s%s%s>%s%s%s %s method %s ] {\n @@ %s %d - %d{$paramFormat}{$returnFormat}\n}\n", |
141 | - $this->getDocComment() ? $this->getDocComment() . "\n" : '', |
|
141 | + $this->getDocComment() ? $this->getDocComment()."\n" : '', |
|
142 | 142 | $prototype ? ", overwrites {$prototypeClass}, prototype {$prototypeClass}" : '', |
143 | 143 | $this->isConstructor() ? ', ctor' : '', |
144 | 144 | $this->isDestructor() ? ', dtor' : '', |
@@ -410,7 +410,7 @@ discard block |
||
410 | 410 | { |
411 | 411 | return |
412 | 412 | interface_exists($this->className, false) || |
413 | - trait_exists($this->className, false) || |
|
414 | - class_exists($this->className, false); |
|
413 | + trait_exists($this->className, false) || |
|
414 | + class_exists($this->className, false); |
|
415 | 415 | } |
416 | 416 | } |
@@ -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,9 +108,9 @@ 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 | - trait_exists($this->type, false) || |
|
114 | - class_exists($this->type, false); |
|
113 | + trait_exists($this->type, false) || |
|
114 | + class_exists($this->type, false); |
|
115 | 115 | } |
116 | 116 | } |