| Conditions | 3 |
| Paths | 3 |
| Total Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | 5 | public function setCouponSheets( $coupon_sheets ) |
|
| 15 | { |
||
| 16 | 5 | if ($coupon_sheets instanceOf \Traversable) |
|
| 17 | 5 | $coupon_sheets = iterator_to_array( $coupon_sheets, "use_keys"); |
|
| 18 | |||
| 19 | 5 | elseif (!is_array($coupon_sheets)) |
|
| 20 | 5 | throw new \InvalidArgumentException("Array or Traversable expected"); |
|
| 21 | |||
| 22 | |||
| 23 | 5 | $this->coupon_sheets = $coupon_sheets; |
|
| 24 | 5 | return $this; |
|
| 25 | } |
||
| 26 | |||
| 30 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. It has, however, found a similar but not annotated parameter which might be a good fit.
Consider the following example. The parameter
$irelandis not defined by the methodfinale(...).The most likely cause is that the parameter was changed, but the annotation was not.