| Conditions | 2 |
| Paths | 1 |
| Total Lines | 10 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2.0116 |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | 1 | public function run($field, $data) |
|
| 9 | { |
||
| 10 | 1 | $value = $this->getFieldValue($field, $data); |
|
| 11 | 1 | return $this->evaluateResult( |
|
| 12 | $field, |
||
| 13 | 1 | preg_match_all(is_string($field['options']) ? |
|
|
|
|||
| 14 | 1 | $field['options'] : $field['options'][0], $value), |
|
| 15 | 1 | "The format of your input is invalid" |
|
| 16 | ); |
||
| 17 | } |
||
| 18 | } |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: