| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 82 | public function jsonSerialize() |
||
| 83 | { |
||
| 84 | $expiryDate = null; |
||
| 85 | if ($this->expiryDate instanceof \DateTime) { |
||
| 86 | $expiryDate = $this->expiryDate->format(\DateTime::ISO8601); |
||
| 87 | } |
||
| 88 | return [ |
||
| 89 | 'expiryDate' => $expiryDate, |
||
| 90 | 'expiryInterval' => $this->getExpiryInterval(), |
||
| 91 | 'url' => $this->url, |
||
| 92 | ]; |
||
| 93 | } |
||
| 94 | } |
||
| 95 |
In PHP, under loose comparison (like
==, or!=, orswitchconditions), values of different types might be equal.For
stringvalues, the empty string''is a special case, in particular the following results might be unexpected: