original_string: public function setExpiry(?\DateTimeImmutable $expiry = null): void
      {
          $date = new \DateTimeImmutable();
          $expiry = $expiry ?: $date;
  
          $this->setHeader('Date', $date->setTimezone(new \DateTimeZone('UTC'))->format('D, d M Y H:i:s \G\M\T'));
          $this->setHeader('Expires', $expiry->setTimezone(new \DateTimeZone('UTC'))->format('D, d M Y H:i:s \G\M\T'));
  
          if ($expiry <= $date) {
              $this->setHeader('Cache-Control', 'no-cache, no-store, must-revalidate, max-age=0');
  
              return;
          }
  
          $maxAge = $expiry->getTimestamp() - $date->getTimestamp();
          $this->setHeader('Cache-Control', 'public, max-age=' . $maxAge);
      }
code: public function setExpiry(?\DateTimeImmutable $expiry = null): void
      {
          $date = new \DateTimeImmutable();
          $expiry = $expiry ?: $date;
  
          $this->setHeader('Date', $date->setTimezone(new \DateTimeZone('UTC'))->format('D, d M Y H:i:s \G\M\T'));
          $this->setHeader('Expires', $expiry->setTimezone(new \DateTimeZone('UTC'))->format('D, d M Y H:i:s \G\M\T'));
  
          if ($expiry <= $date) {
              $this->setHeader('Cache-Control', 'no-cache, no-store, must-revalidate, max-age=0');
  
              return;
          }
  
          $maxAge = $expiry->getTimestamp() - $date->getTimestamp();
          $this->setHeader('Cache-Control', 'public, max-age=' . $maxAge);
      }
code_tokens: public function setExpiry ( ? \ DateTimeImmutable $ expiry = null ) : void { $ date = new \ DateTimeImmutable ( ) ; $ expiry = $ expiry ? : $ date ; $ this -> setHeader ( 'Date' , $ date -> setTimezone ( new \ DateTimeZone ( 'UTC' ) ) -> format ( 'D, d M Y H:i:s \G\M\T' ) ) ; $ this -> setHeader ( 'Expires' , $ expiry -> setTimezone ( new \ DateTimeZone ( 'UTC' ) ) -> format ( 'D, d M Y H:i:s \G\M\T' ) ) ; if ( $ expiry <= $ date ) { $ this -> setHeader ( 'Cache-Control' , 'no-cache, no-store, must-revalidate, max-age=0' ) ; return ; } $ maxAge = $ expiry -> getTimestamp ( ) - $ date -> getTimestamp ( ) ; $ this -> setHeader ( 'Cache-Control' , 'public, max-age=' . $ maxAge ) ; }
docstring: Sets the expiry time.
  
  @since 1.0.0
  
  @param \DateTimeImmutable|null $expiry The expiry time or null for immediate expiry.
docstring_tokens: Sets the expiry time .