1 | <?php |
||
12 | class Statement implements StatementInterface |
||
13 | { |
||
14 | use StatementTrait; |
||
15 | |||
16 | /** |
||
17 | * @var PDOAdapter |
||
18 | */ |
||
19 | private $connection; |
||
20 | |||
21 | /** |
||
22 | * @var PDOStatement |
||
23 | */ |
||
24 | private $stmt; |
||
25 | |||
26 | /** |
||
27 | * PDOStatement constructor. |
||
28 | * @param PDOAdapter $connection |
||
29 | * @param PDOStatement $statement |
||
30 | * @param array $values |
||
31 | */ |
||
32 | public function __construct(PDOAdapter $connection, PDOStatement $statement, array $values = null) |
||
38 | |||
39 | /** |
||
40 | * @inheritDoc |
||
41 | */ |
||
42 | final public function getConnection(): AdapterInterface |
||
46 | |||
47 | /** |
||
48 | * @inheritDoc |
||
49 | */ |
||
50 | public function getQueryString(): string |
||
54 | |||
55 | /** |
||
56 | * @inheritDoc |
||
57 | * @return PDOStatement |
||
58 | */ |
||
59 | public function getWrappedStatement() |
||
63 | |||
64 | /** |
||
65 | * @inheritDoc |
||
66 | */ |
||
67 | public function bind(): void |
||
77 | |||
78 | /** |
||
79 | * Bind :named parameters |
||
80 | */ |
||
81 | protected function bindNamedParameters(): void |
||
88 | |||
89 | /** |
||
90 | * Bind ? parameters |
||
91 | */ |
||
92 | protected function bindNumericParameters(): void |
||
101 | |||
102 | /** |
||
103 | * Attempt to convert non-scalar values. |
||
104 | * |
||
105 | * @param $value |
||
106 | * @return string |
||
107 | */ |
||
108 | protected function toScalar($value) |
||
126 | |||
127 | /** |
||
128 | * @param $var |
||
129 | * @return int |
||
130 | */ |
||
131 | protected function getPdoType($value) |
||
149 | |||
150 | /** |
||
151 | * @inheritDoc |
||
152 | */ |
||
153 | public function preview(): string |
||
198 | |||
199 | /** |
||
200 | * @inheritDoc |
||
201 | */ |
||
202 | public function createResult(): ResultInterface |
||
206 | |||
207 | /** |
||
208 | * @inheritDoc |
||
209 | */ |
||
210 | public function __toString(): string |
||
214 | } |
||
215 |
Our type inference engine has found an assignment of a scalar value (like a string, an integer or null) to a property which is an array.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property.
To type hint that a parameter can be either an array or null, you can set a type hint of array and a default value of null. The PHP interpreter will then accept both an array or null for that parameter.
The function can be called with either null or an array for the parameter
$needle
but will only accept an array as$haystack
.