/**
  * {@inheritdoc}
  */
 public function expiresAfter($time)
 {
     $this->expires = new DateTimeImmutable();
     if (!$time instanceof DateInterval) {
         $time = new DateInterval(sprintf('PT%sS', $time));
     }
     $this->expires = $this->expires->add($time);
     return $this;
 }
Ejemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function expiresAfter($time)
 {
     $this->expiration = new \DateTime();
     if (is_int($time)) {
         if ($time < 0) {
             $time = new \DateInterval('PT' . abs($time) . 'S');
             $time->invert = 1;
         } else {
             $time = new \DateInterval('PT' . $time . 'S');
         }
     }
     $this->expiration->add($time);
     return $this;
 }