original_string: public function addIndexFile($file, $type = 'cli')
      {
          $type = strtolower($type);
  
          if (!in_array($type, ['cli', 'web'])) {
              throw new \InvalidArgumentException(sprintf('Index file type "%s" is invalid, must be one of: cli, web', $type));
          }
  
          $this->index[$type] = [$file, realpath($this->path . DIRECTORY_SEPARATOR . $file)];
      }
code: public function addIndexFile($file, $type = 'cli')
      {
          $type = strtolower($type);
  
          if (!in_array($type, ['cli', 'web'])) {
              throw new \InvalidArgumentException(sprintf('Index file type "%s" is invalid, must be one of: cli, web', $type));
          }
  
          $this->index[$type] = [$file, realpath($this->path . DIRECTORY_SEPARATOR . $file)];
      }
code_tokens: public function addIndexFile ( $ file , $ type = 'cli' ) { $ type = strtolower ( $ type ) ; if ( ! in_array ( $ type , [ 'cli' , 'web' ] ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Index file type "%s" is invalid, must be one of: cli, web' , $ type ) ) ; } $ this -> index [ $ type ] = [ $ file , realpath ( $ this -> path . DIRECTORY_SEPARATOR . $ file ) ] ; }
docstring: Adds an index file.
  
  @param string $file The name of the file relative to the project root
  @param string $type The SAPI type (Default: 'cli')
docstring_tokens: Adds an index file .