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