| Conditions | 2 |
| Paths | 2 |
| Total Lines | 22 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 38 | public function __construct(Table $table) |
||
| 39 | { |
||
| 40 | $this->table = $table; |
||
| 41 | |||
| 42 | $fields = array_map( |
||
| 43 | function ($field) { |
||
| 44 | return (string) $field; |
||
| 45 | }, |
||
| 46 | array_values($table->getFields()) |
||
| 47 | ); |
||
| 48 | |||
| 49 | $this->query = $table->getDatabase() |
||
| 50 | ->select() |
||
| 51 | ->from((string) $table) |
||
| 52 | ->columns(...$fields); |
||
| 53 | |||
| 54 | $eventDispatcher = $table->getEventDispatcher(); |
||
| 55 | |||
| 56 | if ($eventDispatcher) { |
||
| 57 | $eventDispatcher->dispatch(new CreateSelectQuery($this)); |
||
|
|
|||
| 58 | } |
||
| 59 | } |
||
| 60 | |||
| 94 |
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: