Conditions | 3 |
Paths | 3 |
Total Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
30 | public function setExpiryInterval($expiry) |
||
31 | { |
||
32 | if (! $expiry) { |
||
|
|||
33 | $this->expiryDate = null; |
||
34 | return $this; |
||
35 | } |
||
36 | |||
37 | $this->expiryInterval = $expiry; |
||
38 | |||
39 | $now = new \DateTime(); |
||
40 | |||
41 | if (is_null($this->expiryDate)) { |
||
42 | $this->expiryDate = $now->add(new \DateInterval($this->expiryInterval)); |
||
43 | } |
||
44 | |||
45 | return $this; |
||
46 | } |
||
47 | |||
95 |
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: