@@ -150,19 +150,19 @@ discard block |
||
| 150 | 150 | $lastVisibility = null; |
| 151 | 151 | $lastVisibilityEnd = -1; |
| 152 | 152 | |
| 153 | - for ($i = $position; $i < $endPosition; $i++){ |
|
| 153 | + for ($i = $position; $i < $endPosition; $i++) { |
|
| 154 | 154 | if ($tokens[$i]['type'] === 'T_CONST') { |
| 155 | 155 | $classElements[] = [ |
| 156 | 156 | 'type' => 'T_CONST', |
| 157 | 157 | 'visibility' => $i <= $lastVisibilityEnd ? $lastVisibility : 'T_PUBLIC', |
| 158 | 158 | 'name' => $tokens[$file->findNext(T_STRING, $i)]['content'] |
| 159 | 159 | ]; |
| 160 | - } elseif($tokens[$i]['type'] === 'T_FUNCTION'){ |
|
| 160 | + } elseif ($tokens[$i]['type'] === 'T_FUNCTION') { |
|
| 161 | 161 | $type = 'T_FUNCTION'; |
| 162 | 162 | $name = $tokens[$file->findNext(T_STRING, $i)]['content']; |
| 163 | - if (strcasecmp($name, '__destruct') === 0){ |
|
| 163 | + if (strcasecmp($name, '__destruct') === 0) { |
|
| 164 | 164 | $type .= '-DESTRUCT'; |
| 165 | - } elseif (strcasecmp($name, '__construct') === 0){ |
|
| 165 | + } elseif (strcasecmp($name, '__construct') === 0) { |
|
| 166 | 166 | $type .= '-CONSTRUCT'; |
| 167 | 167 | } |
| 168 | 168 | |
@@ -173,13 +173,13 @@ discard block |
||
| 173 | 173 | ]; |
| 174 | 174 | $functionStart = $i; |
| 175 | 175 | $functionEnd = $file->findEndOfStatement($i); |
| 176 | - } elseif ($tokens[$i]['type'] === 'T_VARIABLE' && ($i < $functionStart || $i > $functionEnd)){ |
|
| 176 | + } elseif ($tokens[$i]['type'] === 'T_VARIABLE' && ($i < $functionStart || $i > $functionEnd)) { |
|
| 177 | 177 | $classElements[] = [ |
| 178 | 178 | 'type' => 'T_VARIABLE', |
| 179 | 179 | 'visibility' => $i <= $lastVisibilityEnd ? $lastVisibility : 'T_PUBLIC', |
| 180 | 180 | 'name' => $tokens[$i]['content'] |
| 181 | 181 | ]; |
| 182 | - } elseif (in_array($tokens[$i]['type'], ['T_PRIVATE', 'T_PROTECTED', 'T_PUBLIC'])){ |
|
| 182 | + } elseif (in_array($tokens[$i]['type'], ['T_PRIVATE', 'T_PROTECTED', 'T_PUBLIC'])) { |
|
| 183 | 183 | $lastVisibility = $tokens[$i]['type']; |
| 184 | 184 | $lastVisibilityEnd = $file->findEndOfStatement($i); |
| 185 | 185 | } |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | $originalClassElements = $classElements; |
| 189 | 189 | usort($classElements, [$this, 'sort']); |
| 190 | 190 | |
| 191 | - if ($classElements !== $originalClassElements){ |
|
| 191 | + if ($classElements !== $originalClassElements) { |
|
| 192 | 192 | self::throwFixableError($file, $position); |
| 193 | 193 | } |
| 194 | 194 | } |