original_string: protected function hasBOM($filePointer, $encoding)
      {
          $hasBOM = false;
  
          $this->globalFunctionsHelper->rewind($filePointer);
  
          if (array_key_exists($encoding, $this->supportedEncodingsWithBom)) {
              $potentialBom = $this->supportedEncodingsWithBom[$encoding];
              $numBytesInBom = strlen($potentialBom);
  
              $hasBOM = ($this->globalFunctionsHelper->fgets($filePointer, $numBytesInBom + 1) === $potentialBom);
          }
  
          return $hasBOM;
      }
code: protected function hasBOM($filePointer, $encoding)
      {
          $hasBOM = false;
  
          $this->globalFunctionsHelper->rewind($filePointer);
  
          if (array_key_exists($encoding, $this->supportedEncodingsWithBom)) {
              $potentialBom = $this->supportedEncodingsWithBom[$encoding];
              $numBytesInBom = strlen($potentialBom);
  
              $hasBOM = ($this->globalFunctionsHelper->fgets($filePointer, $numBytesInBom + 1) === $potentialBom);
          }
  
          return $hasBOM;
      }
code_tokens: protected function hasBOM ( $ filePointer , $ encoding ) { $ hasBOM = false ; $ this -> globalFunctionsHelper -> rewind ( $ filePointer ) ; if ( array_key_exists ( $ encoding , $ this -> supportedEncodingsWithBom ) ) { $ potentialBom = $ this -> supportedEncodingsWithBom [ $ encoding ] ; $ numBytesInBom = strlen ( $ potentialBom ) ; $ hasBOM = ( $ this -> globalFunctionsHelper -> fgets ( $ filePointer , $ numBytesInBom + 1 ) === $ potentialBom ) ; } return $ hasBOM ; }
docstring: Returns whether the file identified by the given pointer has a BOM.
  
  @param resource $filePointer Pointer to the file to check
  @param string $encoding Encoding of the file to check
  @return bool TRUE if the file has a BOM, FALSE otherwise
docstring_tokens: Returns whether the file identified by the given pointer has a BOM .