original_string: public function open($filePath)
      {
          if ($this->isStreamWrapper($filePath) && (!$this->doesSupportStreamWrapper() || !$this->isSupportedStreamWrapper($filePath))) {
              throw new IOException("Could not open $filePath for reading! Stream wrapper used is not supported for this type of file.");
          }
  
          if (!$this->isPhpStream($filePath)) {
              // we skip the checks if the provided file path points to a PHP stream
              if (!$this->globalFunctionsHelper->file_exists($filePath)) {
                  throw new IOException("Could not open $filePath for reading! File does not exist.");
              } else if (!$this->globalFunctionsHelper->is_readable($filePath)) {
                  throw new IOException("Could not open $filePath for reading! File is not readable.");
              }
          }
  
          try {
              $fileRealPath = $this->getFileRealPath($filePath);
              $this->openReader($fileRealPath);
              $this->isStreamOpened = true;
          } catch (\Exception $exception) {
              throw new IOException("Could not open $filePath for reading! ({$exception->getMessage()})");
          }
      }
code: public function open($filePath)
      {
          if ($this->isStreamWrapper($filePath) && (!$this->doesSupportStreamWrapper() || !$this->isSupportedStreamWrapper($filePath))) {
              throw new IOException("Could not open $filePath for reading! Stream wrapper used is not supported for this type of file.");
          }
  
          if (!$this->isPhpStream($filePath)) {
              // we skip the checks if the provided file path points to a PHP stream
              if (!$this->globalFunctionsHelper->file_exists($filePath)) {
                  throw new IOException("Could not open $filePath for reading! File does not exist.");
              } else if (!$this->globalFunctionsHelper->is_readable($filePath)) {
                  throw new IOException("Could not open $filePath for reading! File is not readable.");
              }
          }
  
          try {
              $fileRealPath = $this->getFileRealPath($filePath);
              $this->openReader($fileRealPath);
              $this->isStreamOpened = true;
          } catch (\Exception $exception) {
              throw new IOException("Could not open $filePath for reading! ({$exception->getMessage()})");
          }
      }
code_tokens: public function open ( $ filePath ) { if ( $ this -> isStreamWrapper ( $ filePath ) && ( ! $ this -> doesSupportStreamWrapper ( ) || ! $ this -> isSupportedStreamWrapper ( $ filePath ) ) ) { throw new IOException ( "Could not open $filePath for reading! Stream wrapper used is not supported for this type of file." ) ; } if ( ! $ this -> isPhpStream ( $ filePath ) ) { // we skip the checks if the provided file path points to a PHP stream if ( ! $ this -> globalFunctionsHelper -> file_exists ( $ filePath ) ) { throw new IOException ( "Could not open $filePath for reading! File does not exist." ) ; } else if ( ! $ this -> globalFunctionsHelper -> is_readable ( $ filePath ) ) { throw new IOException ( "Could not open $filePath for reading! File is not readable." ) ; } } try { $ fileRealPath = $ this -> getFileRealPath ( $ filePath ) ; $ this -> openReader ( $ fileRealPath ) ; $ this -> isStreamOpened = true ; } catch ( \ Exception $ exception ) { throw new IOException ( "Could not open $filePath for reading! ({$exception->getMessage()})" ) ; } }
docstring: Prepares the reader to read the given file. It also makes sure
  that the file exists and is readable.
  
  @api
  @param  string $filePath Path of the file to be read
  @return void
  @throws \Box\Spout\Common\Exception\IOException If the file at the given path does not exist, is not readable or is corrupted
docstring_tokens: Prepares the reader to read the given file . It also makes sure that the file exists and is readable .