Conditions | 4 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 4 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
41 | 1 | public function expiresAfter($time) |
|
42 | { |
||
43 | 1 | $when = null; |
|
44 | 1 | if (is_object($time) && ($time instanceof DateInterval)) { |
|
45 | 1 | $expiration = new \DateTime(); |
|
46 | 1 | $when = $expiration->add($time)->getTimestamp(); |
|
47 | 1 | } elseif (is_int($time)) { |
|
48 | 1 | $when = time() + $time; |
|
49 | } |
||
50 | 1 | $this->expire = $when; |
|
51 | 1 | return $this; |
|
52 | } |
||
59 |