original_string: public function saveHtml($filename, $base = null)
      {
          $this->ensureWritableDirectory(dirname($filename));
  
          $html = new Html($this->getHtml());
  
          if (null !== $base) {
              $html->resolveLinks(\GuzzleHttp\Psr7\uri_for($base));
          }
  
          file_put_contents($filename, $html->get());
  
          return $this;
      }
code: public function saveHtml($filename, $base = null)
      {
          $this->ensureWritableDirectory(dirname($filename));
  
          $html = new Html($this->getHtml());
  
          if (null !== $base) {
              $html->resolveLinks(\GuzzleHttp\Psr7\uri_for($base));
          }
  
          file_put_contents($filename, $html->get());
  
          return $this;
      }
code_tokens: public function saveHtml ( $ filename , $ base = null ) { $ this -> ensureWritableDirectory ( dirname ( $ filename ) ) ; $ html = new Html ( $ this -> getHtml ( ) ) ; if ( null !== $ base ) { $ html -> resolveLinks ( \ GuzzleHttp \ Psr7 \ uri_for ( $ base ) ) ; } file_put_contents ( $ filename , $ html -> get ( ) ) ; return $ this ; }
docstring: Save the HTML of the session into a file
  Optionally resolve all the links with a base uri
  
  @param  string              $filename
  @throws InvalidArgumentException if directory doesnt exist or is not writable
  @param  UriInterface|string $base
docstring_tokens: Save the HTML of the session into a file Optionally resolve all the links with a base uri