1 | <?php |
||
12 | class TaskEvent |
||
13 | { |
||
14 | /** |
||
15 | * @var integer |
||
16 | * |
||
17 | * @ORM\Column(name="id", type="integer") |
||
18 | * @ORM\Id |
||
19 | * @ORM\GeneratedValue(strategy="AUTO") |
||
20 | */ |
||
21 | private $id; |
||
22 | |||
23 | /** |
||
24 | * @var string |
||
25 | * |
||
26 | * @ORM\Column(name="task_name", type="string", length=100) |
||
27 | */ |
||
28 | private $taskName; |
||
29 | |||
30 | |||
31 | /** |
||
32 | * Many of the Tasks that are run have a specified time that they run for. Because of this, we store the TargetTime |
||
33 | * outside of the payload. This helps significantly with querying what commands have been run for a date, as well. |
||
34 | * |
||
35 | * @var \DateTime |
||
36 | * |
||
37 | * @ORM\Column(name="target_time", type="datetime", nullable=true) |
||
38 | */ |
||
39 | private $targetTime; |
||
40 | |||
41 | /** |
||
42 | * @var array |
||
43 | * |
||
44 | * @ORM\Column(name="payload", type="array") |
||
45 | */ |
||
46 | private $payload; |
||
47 | |||
48 | /** |
||
49 | * @var \DateTime |
||
50 | * |
||
51 | * @ORM\Column(name="initiated_at", type="datetime", nullable=true) |
||
52 | */ |
||
53 | private $initiatedAt; |
||
54 | |||
55 | /** |
||
56 | * @var \DateTime |
||
57 | * |
||
58 | * @ORM\Column(name="failed_at", type="datetime", nullable=true) |
||
59 | */ |
||
60 | private $failedAt; |
||
61 | |||
62 | /** |
||
63 | * @var \DateTime |
||
64 | * |
||
65 | * @ORM\Column(name="completed_at", type="datetime", nullable=true) |
||
66 | */ |
||
67 | private $completedAt; |
||
68 | |||
69 | /** |
||
70 | * @var array |
||
71 | * |
||
72 | * @ORM\Column(name="errors", type="json_array", nullable=true) |
||
73 | */ |
||
74 | private $errors; |
||
75 | |||
76 | /** |
||
77 | * @return int |
||
78 | */ |
||
79 | public function getId() |
||
83 | |||
84 | /** |
||
85 | * @return string |
||
86 | */ |
||
87 | public function getTaskName() |
||
91 | |||
92 | /** |
||
93 | * @param string $taskName |
||
94 | * @return TaskEvent |
||
95 | */ |
||
96 | public function setTaskName($taskName) |
||
101 | |||
102 | /** |
||
103 | * @return array |
||
104 | */ |
||
105 | public function getPayload() |
||
109 | |||
110 | /** |
||
111 | * @param array $payload |
||
112 | * @return TaskEvent |
||
113 | */ |
||
114 | public function setPayload($payload) |
||
119 | |||
120 | /** |
||
121 | * @return \DateTime |
||
122 | */ |
||
123 | 1 | public function getInitiatedAt() |
|
127 | |||
128 | /** |
||
129 | * @param \DateTime $initiatedAt |
||
130 | * @return TaskEvent |
||
131 | */ |
||
132 | 1 | public function setInitiatedAt(\DateTime $initiatedAt) |
|
137 | |||
138 | /** |
||
139 | * @return \DateTime |
||
140 | */ |
||
141 | 2 | public function getCompletedAt() |
|
145 | |||
146 | /** |
||
147 | * @param \DateTime $completedAt |
||
148 | * @return TaskEvent |
||
149 | */ |
||
150 | 2 | public function setCompletedAt(\DateTime $completedAt) |
|
155 | |||
156 | /** |
||
157 | * @return \DateTime |
||
158 | */ |
||
159 | 2 | public function getFailedAt() |
|
163 | |||
164 | /** |
||
165 | * @param $failedAt |
||
166 | * @return $this |
||
167 | */ |
||
168 | 2 | public function setFailedAt(\DateTime $failedAt) |
|
173 | |||
174 | /** |
||
175 | * @return array |
||
176 | */ |
||
177 | 4 | public function getErrors() |
|
181 | |||
182 | /** |
||
183 | * @param array|null $errors |
||
184 | * @return $this |
||
185 | */ |
||
186 | 4 | public function setErrors(array $errors = null) |
|
192 | |||
193 | /** |
||
194 | * @return \DateTime |
||
195 | */ |
||
196 | public function getTargetTime() |
||
200 | |||
201 | /** |
||
202 | * @param \DateTime $targetTime |
||
203 | * @return $this |
||
204 | */ |
||
205 | public function setTargetTime($targetTime = null) |
||
211 | } |
||
212 |
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
.