@@ -31,7 +31,7 @@ |
||
31 | 31 | } |
32 | 32 | } |
33 | 33 | |
34 | - array_walk_recursive($opts, function (&$val) { |
|
34 | + array_walk_recursive($opts, function(&$val) { |
|
35 | 35 | if ('true' === $val) { |
36 | 36 | $val = true; |
37 | 37 | } elseif ('false' === $val) { |
@@ -39,7 +39,7 @@ |
||
39 | 39 | $typedArrayType->getType() instanceof ArrayType |
40 | 40 | || $typedArrayType->getType() instanceof UndefinedType |
41 | 41 | ) { |
42 | - return $typedArrayType; // e.g. array[][] or [][] |
|
42 | + return $typedArrayType; // e.g. array[][] or [][] |
|
43 | 43 | } |
44 | 44 | } |
45 | 45 |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | */ |
30 | 30 | public function toString(): string |
31 | 31 | { |
32 | - return '?' . $this->type->toString(); |
|
32 | + return '?'.$this->type->toString(); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | public function toDocString(): string |
@@ -37,6 +37,6 @@ discard block |
||
37 | 37 | $rawType = $this->type->toString(); |
38 | 38 | |
39 | 39 | // This must match sorting in CompoundType::toString() for raw comparisons. |
40 | - return $rawType > 'null' ? 'null|' . $rawType : $rawType . '|null'; |
|
40 | + return $rawType > 'null' ? 'null|'.$rawType : $rawType.'|null'; |
|
41 | 41 | } |
42 | 42 | } |
@@ -38,6 +38,6 @@ |
||
38 | 38 | $innerType = sprintf('(%s)', $innerType); |
39 | 39 | } |
40 | 40 | |
41 | - return $innerType . str_repeat('[]', $this->depth); |
|
41 | + return $innerType.str_repeat('[]', $this->depth); |
|
42 | 42 | } |
43 | 43 | } |
@@ -44,7 +44,7 @@ |
||
44 | 44 | } |
45 | 45 | |
46 | 46 | if (null !== $tagLineNum) { |
47 | - $rawTags[$tagLineNum] = ($rawTags[$tagLineNum] ?? '') . ' ' . trim($rawLine); |
|
47 | + $rawTags[$tagLineNum] = ($rawTags[$tagLineNum] ?? '').' '.trim($rawLine); |
|
48 | 48 | } elseif (!empty($rawLine) || !empty($descLines)) { |
49 | 49 | // Always append non-empty lines, but also append empty lines if we have |
50 | 50 | // non-empty lines already. More non-empty lines might follow. |
@@ -15,7 +15,7 @@ |
||
15 | 15 | ?string $originId |
16 | 16 | ): void { |
17 | 17 | if (null !== $originId) { |
18 | - $violationId = substr(md5($message . $originId), 0, 16); |
|
18 | + $violationId = substr(md5($message.$originId), 0, 16); |
|
19 | 19 | $message = sprintf('%s [%s]', $message, $violationId); |
20 | 20 | } |
21 | 21 |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | function getRealFilePath(string $filePath): string |
88 | 88 | { |
89 | 89 | if ('.' === $filePath[0]) { |
90 | - $realFilePath = realpath(getcwd() . '/' . $filePath); |
|
90 | + $realFilePath = realpath(getcwd().'/'.$filePath); |
|
91 | 91 | } else { |
92 | 92 | $realFilePath = $filePath; |
93 | 93 | } |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | |
102 | 102 | function getLineHash(string $fileLine, string $errorLine): string |
103 | 103 | { |
104 | - return md5(trim($fileLine . $errorLine)); |
|
104 | + return md5(trim($fileLine.$errorLine)); |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | function findViolationId(string $line): ?string |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | break; |
71 | 71 | } |
72 | 72 | |
73 | - $fqcn = ($namespace ? $namespace . '\\' : '') . $className; |
|
73 | + $fqcn = ($namespace ? $namespace.'\\' : '').$className; |
|
74 | 74 | |
75 | 75 | // Instead of looking for doc blocks , we look for tokens |
76 | 76 | // that should be preceded / followed by a doc block. This way we can |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | switch ($tokenCode) { |
92 | 92 | case T_CONST: |
93 | 93 | $constName = TokenHelper::getDeclarationName($file, $ptr); |
94 | - [$valueType,] = TokenHelper::getAssignmentType($file, $ptr); |
|
94 | + [$valueType, ] = TokenHelper::getAssignmentType($file, $ptr); |
|
95 | 95 | $docBlock = TokenHelper::getPrevDocBlock($file, $ptr, $skip); |
96 | 96 | $attrNames = TokenHelper::getPrevAttributeNames($file, $ptr); |
97 | 97 | $currentElement = new ConstElement($line, $docBlock, $namespace, $constName, $valueType, $attrNames); |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | case T_CONST: |
138 | 138 | $docBlock = TokenHelper::getPrevDocBlock($file, $ptr, $skip); |
139 | 139 | $attrNames = TokenHelper::getPrevAttributeNames($file, $ptr); |
140 | - [$valueType,] = TokenHelper::getAssignmentType($file, $ptr); |
|
140 | + [$valueType, ] = TokenHelper::getAssignmentType($file, $ptr); |
|
141 | 141 | $currentElement = new ClassConstElement($line, $docBlock, $fqcn, $decName, $valueType, $attrNames); |
142 | 142 | $parentElement->addConstant($currentElement); |
143 | 143 | break; |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | case T_CONST: |
197 | 197 | $docBlock = TokenHelper::getPrevDocBlock($file, $ptr, $skip); |
198 | 198 | $attrNames = TokenHelper::getPrevAttributeNames($file, $ptr); |
199 | - [$valueType,] = TokenHelper::getAssignmentType($file, $ptr); |
|
199 | + [$valueType, ] = TokenHelper::getAssignmentType($file, $ptr); |
|
200 | 200 | $currentElement = new InterfaceConstElement($line, $docBlock, $fqcn, $decName, $valueType, $attrNames); |
201 | 201 | $parentElement->addConstant($currentElement); |
202 | 202 | break; |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | case T_NULLABLE: |
78 | 78 | case T_INLINE_THEN: // looks like a phpcs bug |
79 | 79 | // these cannot be default |
80 | - $raw['type'] = ($raw['type'] ?? '') . $token['content']; |
|
80 | + $raw['type'] = ($raw['type'] ?? '').$token['content']; |
|
81 | 81 | break; |
82 | 82 | case T_EQUAL: |
83 | 83 | $raw['default'] = ''; |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | if (isset($raw['default'])) { |
90 | 90 | $raw['default'] .= $token['content']; |
91 | 91 | } else { |
92 | - $raw['type'] = ($raw['type'] ?? '') . $token['content']; |
|
92 | + $raw['type'] = ($raw['type'] ?? '').$token['content']; |
|
93 | 93 | } |
94 | 94 | break; |
95 | 95 | case T_ELLIPSIS: |