original_string: public function create(LibraryType $library, DirectoryItem $item): bool
      {
          // do not allow empty paths
          if (empty($item->path) || empty($item->name)) {
              return false;
          }
  
          $uri = sprintf(
              '%s/repos/%s/file/?p=%s',
              $this->clipUri($this->client->getConfig('base_uri')),
              $library->id,
              $this->urlEncodePath($item->path . $item->name)
          );
  
          $response = $this->client->request(
              'POST',
              $uri,
              [
                  'headers'   => ['Accept' => 'application/json'],
                  'multipart' => [
                      [
                          'name'     => 'operation',
                          'contents' => 'create',
                      ],
                  ],
              ]
          );
  
          return $response->getStatusCode() === 201;
      }
code: public function create(LibraryType $library, DirectoryItem $item): bool
      {
          // do not allow empty paths
          if (empty($item->path) || empty($item->name)) {
              return false;
          }
  
          $uri = sprintf(
              '%s/repos/%s/file/?p=%s',
              $this->clipUri($this->client->getConfig('base_uri')),
              $library->id,
              $this->urlEncodePath($item->path . $item->name)
          );
  
          $response = $this->client->request(
              'POST',
              $uri,
              [
                  'headers'   => ['Accept' => 'application/json'],
                  'multipart' => [
                      [
                          'name'     => 'operation',
                          'contents' => 'create',
                      ],
                  ],
              ]
          );
  
          return $response->getStatusCode() === 201;
      }
code_tokens: public function create ( LibraryType $ library , DirectoryItem $ item ) : bool { // do not allow empty paths if ( empty ( $ item -> path ) || empty ( $ item -> name ) ) { return false ; } $ uri = sprintf ( '%s/repos/%s/file/?p=%s' , $ this -> clipUri ( $ this -> client -> getConfig ( 'base_uri' ) ) , $ library -> id , $ this -> urlEncodePath ( $ item -> path . $ item -> name ) ) ; $ response = $ this -> client -> request ( 'POST' , $ uri , [ 'headers' => [ 'Accept' => 'application/json' ] , 'multipart' => [ [ 'name' => 'operation' , 'contents' => 'create' , ] , ] , ] ) ; return $ response -> getStatusCode ( ) === 201 ; }
docstring: Create empty file on Seafile server
  
  @param LibraryType   $library Library instance
  @param DirectoryItem $item    Item instance
  
  @return bool
  @throws \GuzzleHttp\Exception\GuzzleException
docstring_tokens: Create empty file on Seafile server