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 | 1 | * {@inheritdoc} |
|
14 | */ |
||
15 | 1 | public function getName() |
|
16 | { |
||
17 | 1 | return 'ApiClients/empty_line_above_docblocks'; |
|
18 | 1 | } |
|
19 | 1 | ||
20 | 1 | public function getDefinition() |
|
21 | 1 | { |
|
22 | 1 | return new FixerDefinition( |
|
23 | 1 | 'Ensure there is an empty line behind abstract or interface methods.', |
|
24 | [ |
||
25 | 1 | new CodeSample( |
|
26 | $this->BOM.'<?php |
||
|
|||
27 | |||
28 | echo "Hello!"; |
||
29 | 1 | ' |
|
30 | ), |
||
31 | ] |
||
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: