1 | <?php |
||
23 | final class VarPropertyCommentSniff extends PHP_CodeSniffer_Standards_AbstractVariableSniff |
||
24 | { |
||
25 | |||
26 | /** |
||
27 | * @var string |
||
28 | */ |
||
29 | const NAME = 'ZenifyCodingStandard.Commenting.VarPropertyComment'; |
||
30 | |||
31 | /** |
||
32 | * @param PHP_CodeSniffer_File $file |
||
33 | * @param int $position |
||
34 | */ |
||
35 | 1 | protected function processMemberVar(PHP_CodeSniffer_File $file, $position) |
|
45 | |||
46 | |||
47 | /** |
||
48 | * @param PHP_CodeSniffer_File $file |
||
49 | * @param int $position |
||
50 | */ |
||
51 | 1 | protected function processVariable(PHP_CodeSniffer_File $file, $position) |
|
54 | |||
55 | |||
56 | /** |
||
57 | * @param PHP_CodeSniffer_File $file |
||
58 | * @param int $position |
||
59 | */ |
||
60 | protected function processVariableInString(PHP_CodeSniffer_File $file, $position) |
||
63 | |||
64 | |||
65 | 1 | private function getPropertyComment(PHP_CodeSniffer_File $file, int $position) : string |
|
87 | |||
88 | } |
||
89 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.