| Conditions | 3 |
| Paths | 4 |
| Total Lines | 18 |
| Lines | 18 |
| Ratio | 100 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | View Code Duplication | public function __construct(Table $table, array $data = []) |
|
| 26 | { |
||
| 27 | $this->table = $table; |
||
| 28 | |||
| 29 | $this->query = $table->getDatabase() |
||
| 30 | ->update() |
||
| 31 | ->table((string) $table); |
||
| 32 | |||
| 33 | foreach ($data as $fieldName => $value) { |
||
| 34 | $this->table->{$fieldName}->update($this->query, $value); |
||
| 35 | } |
||
| 36 | |||
| 37 | $eventDispatcher = $table->getEventDispatcher(); |
||
| 38 | |||
| 39 | if ($eventDispatcher) { |
||
| 40 | $eventDispatcher->dispatch(new CreateUpdateQuery($this)); |
||
|
|
|||
| 41 | } |
||
| 42 | } |
||
| 43 | } |
||
| 44 |
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: