Conditions | 3 |
Paths | 3 |
Total Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
96 | 7 | public function expiresAfter($time) |
|
97 | { |
||
98 | 7 | if ($time === null) { |
|
99 | 1 | $this->expires = null; |
|
100 | |||
101 | 1 | return; |
|
102 | } |
||
103 | |||
104 | 6 | $this->expires = new DateTimeImmutable(); |
|
105 | |||
106 | 6 | if (! $time instanceof DateInterval) { |
|
107 | 5 | $time = new DateInterval(sprintf('PT%sS', $time)); |
|
108 | } |
||
109 | |||
110 | 6 | $this->expires = $this->expires->add($time); |
|
111 | |||
112 | 6 | return $this; |
|
113 | } |
||
114 | |||
123 |