1 | <?php |
||
5 | class ContainerCreateResult |
||
6 | { |
||
7 | /** |
||
8 | * @var string |
||
9 | */ |
||
10 | protected $id; |
||
11 | /** |
||
12 | * @var string[] |
||
13 | */ |
||
14 | protected $warnings; |
||
15 | |||
16 | /** |
||
17 | * @return string |
||
18 | */ |
||
19 | public function getId() |
||
23 | |||
24 | /** |
||
25 | * @param string $id |
||
26 | * |
||
27 | * @return self |
||
28 | */ |
||
29 | public function setId($id = null) |
||
35 | |||
36 | /** |
||
37 | * @return string[] |
||
38 | */ |
||
39 | public function getWarnings() |
||
43 | |||
44 | /** |
||
45 | * @param string[] $warnings |
||
46 | * |
||
47 | * @return self |
||
48 | */ |
||
49 | public function setWarnings(array $warnings = null) |
||
55 | } |
||
56 |
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
.