| Conditions | 5 |
| Paths | 3 |
| Total Lines | 18 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 5 |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 13 | * {@inheritdoc} |
||
| 14 | */ |
||
| 15 | public function getName() |
||
| 16 | { |
||
| 17 | return 'ApiClients/empty_line_above_docblocks'; |
||
| 18 | } |
||
| 19 | |||
| 20 | public function getDefinition() |
||
| 21 | { |
||
| 22 | return new FixerDefinition( |
||
| 23 | 'Ensure there is an empty line behind abstract or interface methods.', |
||
| 24 | [ |
||
| 25 | new CodeSample( |
||
| 26 | $this->BOM.'<?php |
||
|
|
|||
| 27 | |||
| 28 | echo "Hello!"; |
||
| 29 | ' |
||
| 30 | ), |
||
| 31 | ] |
||
| 68 |
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: