| Conditions | 3 |
| Paths | 3 |
| Total Lines | 12 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 88 | 8 | public function setExpiration($ttl = null) |
|
| 89 | { |
||
| 90 | 8 | if (true === is_numeric($ttl)) { |
|
| 91 | 1 | $this->expiration = new DateTime('now +' . $ttl . ' seconds'); |
|
| 92 | 8 | } elseif ($ttl instanceof DateTime) { |
|
| 93 | 1 | $this->expiration = $ttl; |
|
| 94 | 1 | } else { |
|
| 95 | 8 | $this->expiration = new DateTime('now +10 years'); |
|
| 96 | } |
||
| 97 | |||
| 98 | 8 | return $this; |
|
| 99 | } |
||
| 100 | |||
| 126 |