original_string: protected function findMatchingCookies($scheme, $host, $path)
      {
          $out = [];
          $now = new DateTimeImmutable('now', new DateTimeZone('UTC'));
          foreach ($this->cookies as $cookie) {
              if ($scheme === 'http' && $cookie->isSecure()) {
                  continue;
              }
              if (strpos($path, $cookie->getPath()) !== 0) {
                  continue;
              }
              $domain = $cookie->getDomain();
              $leadingDot = substr($domain, 0, 1) === '.';
              if ($leadingDot) {
                  $domain = ltrim($domain, '.');
              }
  
              if ($cookie->isExpired($now)) {
                  continue;
              }
  
              $pattern = '/' . preg_quote($domain, '/') . '$/';
              if (!preg_match($pattern, $host)) {
                  continue;
              }
  
              $out[$cookie->getName()] = $cookie->getValue();
          }
  
          return $out;
      }
code: protected function findMatchingCookies($scheme, $host, $path)
      {
          $out = [];
          $now = new DateTimeImmutable('now', new DateTimeZone('UTC'));
          foreach ($this->cookies as $cookie) {
              if ($scheme === 'http' && $cookie->isSecure()) {
                  continue;
              }
              if (strpos($path, $cookie->getPath()) !== 0) {
                  continue;
              }
              $domain = $cookie->getDomain();
              $leadingDot = substr($domain, 0, 1) === '.';
              if ($leadingDot) {
                  $domain = ltrim($domain, '.');
              }
  
              if ($cookie->isExpired($now)) {
                  continue;
              }
  
              $pattern = '/' . preg_quote($domain, '/') . '$/';
              if (!preg_match($pattern, $host)) {
                  continue;
              }
  
              $out[$cookie->getName()] = $cookie->getValue();
          }
  
          return $out;
      }
code_tokens: protected function findMatchingCookies ( $ scheme , $ host , $ path ) { $ out = [ ] ; $ now = new DateTimeImmutable ( 'now' , new DateTimeZone ( 'UTC' ) ) ; foreach ( $ this -> cookies as $ cookie ) { if ( $ scheme === 'http' && $ cookie -> isSecure ( ) ) { continue ; } if ( strpos ( $ path , $ cookie -> getPath ( ) ) !== 0 ) { continue ; } $ domain = $ cookie -> getDomain ( ) ; $ leadingDot = substr ( $ domain , 0 , 1 ) === '.' ; if ( $ leadingDot ) { $ domain = ltrim ( $ domain , '.' ) ; } if ( $ cookie -> isExpired ( $ now ) ) { continue ; } $ pattern = '/' . preg_quote ( $ domain , '/' ) . '$/' ; if ( ! preg_match ( $ pattern , $ host ) ) { continue ; } $ out [ $ cookie -> getName ( ) ] = $ cookie -> getValue ( ) ; } return $ out ; }
docstring: Find cookies matching the scheme, host, and path
  
  @param string $scheme The http scheme to match
  @param string $host The host to match.
  @param string $path The path to match
  @return array An array of cookie name/value pairs
docstring_tokens: Find cookies matching the scheme host and path