Conditions | 5 |
Paths | 4 |
Total Lines | 16 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
65 | public function isActive() |
||
66 | { |
||
67 | if (!count($this->files)) { |
||
68 | throw new \RuntimeException('At least one file path must be defined'); |
||
69 | } |
||
70 | |||
71 | foreach ($this->files as $file) { |
||
72 | $file = realpath($file); |
||
73 | |||
74 | if (file_exists($file) && is_file($file)) { |
||
75 | return true; |
||
76 | } |
||
77 | } |
||
78 | |||
79 | return false; |
||
80 | } |
||
81 | } |
||
82 |
This check looks for
@param
annotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive. In addition it looks for parameters that have the generic type
array
and suggests a stricter type likearray<String>
.Most often this is a case of a parameter that can be null in addition to its declared types.