| Conditions | 4 |
| Paths | 4 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 33 | 11 | public function getValue() |
|
| 34 | { |
||
| 35 | 11 | if (is_callable($this->valueOrCallable)) { |
|
| 36 | 3 | return call_user_func($this->valueOrCallable, $this->item); |
|
| 37 | } |
||
| 38 | |||
| 39 | 8 | if (!is_null($this->valueOrCallable)) { |
|
| 40 | 3 | return $this->valueOrCallable; |
|
| 41 | } |
||
| 42 | |||
| 43 | 8 | return is_numeric($this->item) ? $this->item : 0; |
|
| 44 | } |
||
| 45 | |||
| 54 |
This check looks for
@paramannotations 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
arrayand 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.