Conditions | 6 |
Paths | 5 |
Total Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
18 | public function getDeletedAt($format = null) |
||
|
|||
19 | { |
||
20 | switch (true) { |
||
21 | case is_string($this->deleted_at): |
||
22 | case is_object($this->deleted_at) && get_class($this->deleted_at) !== 'DateTime': |
||
23 | throw new \Exception("deleted_at is not a datetime", 400); |
||
24 | case $this->deleted_at === null: |
||
25 | case $format === null: |
||
26 | return $this->deleted_at; |
||
27 | default: |
||
28 | return $this->deleted_at->format($format); |
||
29 | } |
||
30 | } |
||
31 | |||
56 |
Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a
@return
annotation as described here.