original_string: protected function openFile(string $file, string $mode)
      {
          $fp = @fopen($file, $mode);
          if (false === $fp) {
              throw new StreamException(
                      'Can not open file ' . $file . ' with mode ' . $mode . ': '
                      .
                      str_replace('fopen(' . $file . '): ', '', lastErrorMessage())
              );
          }
  
          return $fp;
      }
code: protected function openFile(string $file, string $mode)
      {
          $fp = @fopen($file, $mode);
          if (false === $fp) {
              throw new StreamException(
                      'Can not open file ' . $file . ' with mode ' . $mode . ': '
                      .
                      str_replace('fopen(' . $file . '): ', '', lastErrorMessage())
              );
          }
  
          return $fp;
      }
code_tokens: protected function openFile ( string $ file , string $ mode ) { $ fp = @ fopen ( $ file , $ mode ) ; if ( false === $ fp ) { throw new StreamException ( 'Can not open file ' . $ file . ' with mode ' . $ mode . ': ' . str_replace ( 'fopen(' . $ file . '): ' , '' , lastErrorMessage ( ) ) ) ; } return $ fp ; }
docstring: helper method to open a file handle
  
  @param   string   $file
  @param   string   $mode
  @return  resource
  @throws  \stubbles\streams\StreamException
docstring_tokens: helper method to open a file handle