1 | <?php |
||
14 | class Insert |
||
15 | { |
||
16 | /** |
||
17 | * @var Document |
||
18 | */ |
||
19 | private $document; |
||
20 | |||
21 | /** |
||
22 | * @var float |
||
23 | */ |
||
24 | private $defaultBoost = 1.0; |
||
25 | |||
26 | /** |
||
27 | * Insert constructor. |
||
28 | * |
||
29 | * @param Document $document |
||
30 | */ |
||
31 | 22 | public function __construct(Document $document) |
|
35 | |||
36 | /** |
||
37 | * Insert |
||
38 | * |
||
39 | * @param integer $id |
||
40 | * @param Index $index |
||
41 | * @param array $fields fields that are indexed |
||
42 | * @param boolean|string $uid unique identifier, if required |
||
43 | * @param array $boostFields |
||
44 | * @return mixed |
||
45 | */ |
||
46 | 1 | public function insert(Index $index, $id, array $fields, $uid = false, array $boostFields = []) |
|
53 | |||
54 | /** |
||
55 | * @param string|integer $field |
||
56 | * @param string $value |
||
57 | * @param string $type |
||
58 | * @return Field |
||
59 | */ |
||
60 | 1 | private function field($field, $value, $type = 'keyword', $boost = null) |
|
66 | |||
67 | /** |
||
68 | * @param Document $document |
||
69 | * @param boolean|string $uid |
||
70 | * @return Document |
||
71 | */ |
||
72 | 1 | private function addUid(Document $document, $uid = false) |
|
80 | |||
81 | /** |
||
82 | * @param Document $document |
||
83 | * @param array $fields |
||
84 | * @param array $boostFields |
||
85 | * @return Document |
||
86 | */ |
||
87 | 1 | private function addFields(Document $document, array $fields, array $boostFields = []) |
|
95 | |||
96 | /** |
||
97 | * @param $field |
||
98 | * @param array $boostFields |
||
99 | * @return mixed|null |
||
100 | */ |
||
101 | 2 | private function boost($field, array $boostFields = []) |
|
108 | } |
||
109 |
This check looks at variables that have been passed in as parameters and are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.