1 | <?php |
||
19 | class SpoolManager extends BaseObject |
||
20 | { |
||
21 | /** |
||
22 | * DataProvider classes which hold info for inserting data to elastic |
||
23 | * |
||
24 | * @var AbstractDataProvider[] |
||
25 | */ |
||
26 | public $dataProviders = []; |
||
27 | |||
28 | /** |
||
29 | * Spooling data batch size |
||
30 | * |
||
31 | * @var int |
||
32 | */ |
||
33 | public $batchSize = 100; |
||
34 | |||
35 | /** |
||
36 | * 1) check if index exists, if exists delete and create new one |
||
37 | * 2) get mapping from provider and insert it |
||
38 | * 3) import all products (w/o spool table) |
||
39 | */ |
||
40 | public function reindex() |
||
45 | |||
46 | /** |
||
47 | * Spools data to elastic index |
||
48 | */ |
||
49 | public function spool() |
||
55 | |||
56 | /** |
||
57 | * Creates indexes |
||
58 | * |
||
59 | * @param bool $deleteOld deletes indexes if exists |
||
60 | * @internal param array $indexes |
||
61 | */ |
||
62 | private function createIndexes($deleteOld = true) |
||
78 | |||
79 | /** |
||
80 | * Creates mapping and insets data to elastic |
||
81 | * |
||
82 | * @throws \Exception |
||
83 | * @throws \yii\db\Exception |
||
84 | */ |
||
85 | private function reindexData() |
||
101 | |||
102 | /** |
||
103 | * Mass inserts data to elasticsearch |
||
104 | * |
||
105 | * @param AbstractDataProvider $dataProvider |
||
106 | */ |
||
107 | private function spoolData(AbstractDataProvider $dataProvider) |
||
132 | } |
||
133 | |||
134 |
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: