original_string: protected function removeExpiredCookies($host, $path)
      {
          $time = new DateTimeImmutable('now', new DateTimeZone('UTC'));
          $hostPattern = '/' . preg_quote($host, '/') . '$/';
  
          foreach ($this->cookies as $i => $cookie) {
              $expired = $cookie->isExpired($time);
              $pathMatches = strpos($path, $cookie->getPath()) === 0;
              $hostMatches = preg_match($hostPattern, $cookie->getDomain());
              if ($pathMatches && $hostMatches && $expired) {
                  unset($this->cookies[$i]);
              }
          }
      }
code: protected function removeExpiredCookies($host, $path)
      {
          $time = new DateTimeImmutable('now', new DateTimeZone('UTC'));
          $hostPattern = '/' . preg_quote($host, '/') . '$/';
  
          foreach ($this->cookies as $i => $cookie) {
              $expired = $cookie->isExpired($time);
              $pathMatches = strpos($path, $cookie->getPath()) === 0;
              $hostMatches = preg_match($hostPattern, $cookie->getDomain());
              if ($pathMatches && $hostMatches && $expired) {
                  unset($this->cookies[$i]);
              }
          }
      }
code_tokens: protected function removeExpiredCookies ( $ host , $ path ) { $ time = new DateTimeImmutable ( 'now' , new DateTimeZone ( 'UTC' ) ) ; $ hostPattern = '/' . preg_quote ( $ host , '/' ) . '$/' ; foreach ( $ this -> cookies as $ i => $ cookie ) { $ expired = $ cookie -> isExpired ( $ time ) ; $ pathMatches = strpos ( $ path , $ cookie -> getPath ( ) ) === 0 ; $ hostMatches = preg_match ( $ hostPattern , $ cookie -> getDomain ( ) ) ; if ( $ pathMatches && $ hostMatches && $ expired ) { unset ( $ this -> cookies [ $ i ] ) ; } } }
docstring: Remove expired cookies from the collection.
  
  @param string $host The host to check for expired cookies on.
  @param string $path The path to check for expired cookies on.
  @return void
docstring_tokens: Remove expired cookies from the collection .