original_string: public static function checkAccept(array $allowTypes = [])
      {
          $accept = self::getAccept();
  
          // if no parameter was passed, just return first mime type from parsed data
          if (empty($allowTypes)) {
              return current(array_keys($accept));
          }
  
          $allowTypes = array_map('strtolower', $allowTypes);
  
          // let’s check our supported types:
          foreach ($accept as $mime => $quality) {
              if ($quality && \in_array($mime, $allowTypes, true)) {
                  return $mime;
              }
          }
          // no mime-type found
          return false;
      }
code: public static function checkAccept(array $allowTypes = [])
      {
          $accept = self::getAccept();
  
          // if no parameter was passed, just return first mime type from parsed data
          if (empty($allowTypes)) {
              return current(array_keys($accept));
          }
  
          $allowTypes = array_map('strtolower', $allowTypes);
  
          // let’s check our supported types:
          foreach ($accept as $mime => $quality) {
              if ($quality && \in_array($mime, $allowTypes, true)) {
                  return $mime;
              }
          }
          // no mime-type found
          return false;
      }
code_tokens: public static function checkAccept ( array $ allowTypes = [ ] ) { $ accept = self :: getAccept ( ) ; // if no parameter was passed, just return first mime type from parsed data if ( empty ( $ allowTypes ) ) { return current ( array_keys ( $ accept ) ) ; } $ allowTypes = array_map ( 'strtolower' , $ allowTypes ) ; // let’s check our supported types: foreach ( $ accept as $ mime => $ quality ) { if ( $ quality && \ in_array ( $ mime , $ allowTypes , true ) ) { return $ mime ; } } // no mime-type found return false ; }
docstring: Check Accept header
  
  @param array $allowTypes
  
  @return string|false
docstring_tokens: Check Accept header