original_string: public function uploadImage(string $path, string $type = 'icon')
      {
          if (!file_exists($path) || !is_readable($path)) {
              throw new InvalidArgumentException(sprintf('File does not exist, or the file is unreadable: "%s"', $path));
          }
  
          return $this->httpUpload('shakearound/material/add', ['media' => $path], [], ['type' => strtolower($type)]);
      }
code: public function uploadImage(string $path, string $type = 'icon')
      {
          if (!file_exists($path) || !is_readable($path)) {
              throw new InvalidArgumentException(sprintf('File does not exist, or the file is unreadable: "%s"', $path));
          }
  
          return $this->httpUpload('shakearound/material/add', ['media' => $path], [], ['type' => strtolower($type)]);
      }
code_tokens: public function uploadImage ( string $ path , string $ type = 'icon' ) { if ( ! file_exists ( $ path ) || ! is_readable ( $ path ) ) { throw new InvalidArgumentException ( sprintf ( 'File does not exist, or the file is unreadable: "%s"' , $ path ) ) ; } return $ this -> httpUpload ( 'shakearound/material/add' , [ 'media' => $ path ] , [ ] , [ 'type' => strtolower ( $ type ) ] ) ; }
docstring: Upload image material.
  
  @param string $path
  @param string $type
  
  @return string
  
  @throws InvalidArgumentException
docstring_tokens: Upload image material .