| Conditions | 4 | 
| Paths | 3 | 
| Total Lines | 14 | 
| Code Lines | 8 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Tests | 0 | 
| CRAP Score | 20 | 
| Changes | 0 | ||
| 1 | <?php | ||
| 54 | protected function applyFix(\SplFileInfo $file, Tokens $tokens) | ||
| 55 |     { | ||
| 56 |         for ($index = 2; $index < count($tokens); $index++) { | ||
| 57 | $token = $tokens[$index]; | ||
| 58 | $previousToken = $tokens[$index - 1]; | ||
| 59 | $sndPreviousToken = $tokens[$index - 2]; | ||
| 60 |             if ($sndPreviousToken->getContent() !== '{' && | ||
| 61 | substr($token->getContent(), 0, 3) === '/**' /*&& | ||
| 62 | $previousToken->getLine() === $token->getLine() - 1*/ | ||
| 63 |             ) { | ||
| 64 | $previousToken->setContent(PHP_EOL . $previousToken->getContent()); | ||
| 65 | } | ||
| 66 | } | ||
| 67 | } | ||
| 68 | } | ||
| 69 | 
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: