|
@@ -12,7 +12,7 @@ discard block |
|
|
block discarded – undo |
|
12
|
12
|
/** |
|
13
|
13
|
* @throws NotCorrectTtlString |
|
14
|
14
|
*/ |
|
15
|
|
- public function __construct(bool|int|string|\DateTimeInterface $ttl, ?int $currentTimestamp = null) |
|
|
15
|
+ public function __construct(bool | int | string | \DateTimeInterface $ttl, ?int $currentTimestamp = null) |
|
16
|
16
|
{ |
|
17
|
17
|
$this->currentTimestamp = $currentTimestamp ?? time(); |
|
18
|
18
|
$this->setExpires($ttl); |
|
@@ -22,7 +22,7 @@ discard block |
|
|
block discarded – undo |
|
22
|
22
|
* @throws NotCorrectTtlString |
|
23
|
23
|
* @see http://php.net/manual/ru/datetime.formats.relative.php |
|
24
|
24
|
*/ |
|
25
|
|
- private function setExpires(bool|int|string|\DateTimeInterface $ttl): void |
|
|
25
|
+ private function setExpires(bool | int | string | \DateTimeInterface $ttl): void |
|
26
|
26
|
{ |
|
27
|
27
|
if ($ttl instanceof \DateTimeInterface) { |
|
28
|
28
|
$this->expires = $ttl->getTimestamp(); |
Please login to merge, or discard this patch.