| Conditions | 2 |
| Paths | 2 |
| Total Lines | 8 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | 2 | public function submit(Form $form, ArrayHash $values) |
|
| 30 | { |
||
| 31 | 2 | if ($this->connection->hlen($values['key']) > 0) { |
|
| 32 | 2 | $form->addError('Key "' . $values['key'] . '" already exists'); |
|
| 33 | 2 | return; |
|
| 34 | } |
||
| 35 | 2 | $this->connection->hset($values['key'], $values['field'], $values['value']); |
|
| 36 | 2 | } |
|
| 37 | } |
||
| 38 |
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: