1 | <?php |
||
12 | final class Event extends Component |
||
13 | { |
||
14 | /** @var array */ |
||
15 | private $alerts = []; |
||
16 | |||
17 | /** @var \DateTimeInterface */ |
||
18 | private $starts; |
||
19 | |||
20 | /** @var \DateTimeInterface */ |
||
21 | private $ends; |
||
22 | |||
23 | /** @var string */ |
||
24 | private $name; |
||
25 | |||
26 | /** @var string|null */ |
||
27 | private $description; |
||
28 | |||
29 | /** @var string|null */ |
||
30 | private $address; |
||
31 | |||
32 | /** @var string|null */ |
||
33 | private $addressName; |
||
34 | |||
35 | /** @var float|null */ |
||
36 | private $lat; |
||
37 | |||
38 | /** @var float|null */ |
||
39 | private $lng; |
||
40 | |||
41 | /** @var string */ |
||
42 | private $uuid; |
||
43 | |||
44 | /** @var \DateTimeInterface */ |
||
45 | private $created; |
||
46 | |||
47 | /** @var bool */ |
||
48 | private $withTimezone = false; |
||
49 | |||
50 | /** @var bool */ |
||
51 | private $isFullDay = false; |
||
52 | |||
53 | /** @var string */ |
||
54 | private $recurrenceRule; |
||
55 | |||
56 | public static function create(string $name = null): Event |
||
60 | |||
61 | public function __construct(string $name = null) |
||
67 | |||
68 | public function getComponentType(): string |
||
72 | |||
73 | public function getRequiredProperties(): array |
||
81 | |||
82 | public function startsAt(DateTimeInterface $starts): Event |
||
88 | |||
89 | public function endsAt(DateTimeInterface $ends): Event |
||
95 | |||
96 | public function period(DateTimeInterface $starts, DateTimeInterface $ends): Event |
||
103 | |||
104 | public function name(string $name): Event |
||
110 | |||
111 | public function description(string $description): Event |
||
117 | |||
118 | public function address(string $address, string $name = null): Event |
||
128 | |||
129 | public function addressName(string $name): Event |
||
135 | |||
136 | public function coordinates(float $lat, float $lng): Event |
||
143 | |||
144 | public function uniqueIdentifier(string $uid): Event |
||
150 | |||
151 | public function createdAt(DateTimeInterface $created): Event |
||
157 | |||
158 | public function withTimezone(): Event |
||
164 | |||
165 | public function fullDay(): Event |
||
171 | |||
172 | public function alertMinutesBefore(int $minutes, string $message = null): Event |
||
183 | |||
184 | public function recurrenceRule(string $rule): Event |
||
190 | |||
191 | public function getPayload(): ComponentPayload |
||
208 | |||
209 | private function resolveLocationProperties(ComponentPayload $payload): ComponentPayload |
||
232 | } |
||
233 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: