1 | <?php |
||
10 | class ShipmentEvent implements \JsonSerializable |
||
11 | { |
||
12 | /** |
||
13 | * @var \DateTime |
||
14 | * @deprecated |
||
15 | */ |
||
16 | protected $date; |
||
17 | |||
18 | /** |
||
19 | * @var string |
||
20 | */ |
||
21 | protected $description; |
||
22 | |||
23 | /** |
||
24 | * @var string|LocationInterface |
||
25 | */ |
||
26 | protected $location; |
||
27 | |||
28 | /** |
||
29 | * @var string |
||
30 | */ |
||
31 | protected $status; |
||
32 | |||
33 | /** |
||
34 | * @var \DateTime |
||
35 | */ |
||
36 | protected $time; |
||
37 | |||
38 | public function __construct(\DateTime $time = null, $description = null, $location = null) |
||
44 | |||
45 | /** |
||
46 | * @return \DateTime |
||
47 | * @deprecated |
||
48 | */ |
||
49 | public function getDate() |
||
53 | |||
54 | /** |
||
55 | * @param \DateTime $date |
||
56 | * @return ShipmentEvent |
||
57 | * @deprecated |
||
58 | */ |
||
59 | public function setDate($date) |
||
67 | |||
68 | /** |
||
69 | * @return \DateTime |
||
70 | */ |
||
71 | public function getTime() |
||
75 | |||
76 | /** |
||
77 | * @param \DateTime $time |
||
78 | * @return ShipmentEvent |
||
79 | */ |
||
80 | public function setTime($time) |
||
88 | |||
89 | /** |
||
90 | * @return string |
||
91 | */ |
||
92 | public function getDescription() |
||
96 | |||
97 | /** |
||
98 | * @param string $description |
||
99 | * @return ShipmentEvent |
||
100 | */ |
||
101 | public function setDescription($description) |
||
106 | |||
107 | /** |
||
108 | * @return string|LocationInterface |
||
109 | */ |
||
110 | public function getLocation() |
||
114 | |||
115 | /** |
||
116 | * @param string|LocationInterface $location |
||
117 | * @return ShipmentEvent |
||
118 | */ |
||
119 | public function setLocation($location) |
||
124 | |||
125 | /** |
||
126 | * @return string |
||
127 | */ |
||
128 | public function getStatus() |
||
132 | |||
133 | /** |
||
134 | * @param string $status |
||
135 | * @return ShipmentEvent |
||
136 | */ |
||
137 | public function setStatus($status) |
||
142 | |||
143 | /** |
||
144 | * Creates an event from an array |
||
145 | * @param array $data |
||
146 | * @return static |
||
147 | */ |
||
148 | public static function fromArray($data) |
||
158 | |||
159 | /** |
||
160 | * Converts the event to array |
||
161 | * @return array |
||
162 | */ |
||
163 | public function toArray() |
||
178 | |||
179 | /** |
||
180 | * {@inheritdoc} |
||
181 | */ |
||
182 | public function jsonSerialize() |
||
186 | } |
||
187 |
It seems like you allow that null is being passed for a parameter, however the function which is called does not seem to accept null.
We recommend to add an additional type check (or disallow null for the parameter):