original_string: public function getAll(LibraryType $library, string $dir = '/')
      {
          $clippedBaseUri = $this->clipUri($this->client->getConfig('base_uri'));
  
          $response = $this->client->request(
              'GET',
              $clippedBaseUri . '/repos/' . $library->id . '/dir/',
              [
                  'query' => ['p' => $dir],
              ]
          );
  
          $json = json_decode((string)$response->getBody());
  
          $dirItemCollection = [];
  
          foreach ($json as $dirItemJson) {
              $dirItem = (new DirectoryItem)->fromJson($dirItemJson);
  
              // if dirItem has no value for "dir", set it here
              if ($dirItem->dir === '/') {
                  $dirItem = $dirItem->fromArray(['dir' => $dir]);
              }
  
              $dirItemCollection[] = $dirItem;
          }
  
          return $dirItemCollection;
      }
code: public function getAll(LibraryType $library, string $dir = '/')
      {
          $clippedBaseUri = $this->clipUri($this->client->getConfig('base_uri'));
  
          $response = $this->client->request(
              'GET',
              $clippedBaseUri . '/repos/' . $library->id . '/dir/',
              [
                  'query' => ['p' => $dir],
              ]
          );
  
          $json = json_decode((string)$response->getBody());
  
          $dirItemCollection = [];
  
          foreach ($json as $dirItemJson) {
              $dirItem = (new DirectoryItem)->fromJson($dirItemJson);
  
              // if dirItem has no value for "dir", set it here
              if ($dirItem->dir === '/') {
                  $dirItem = $dirItem->fromArray(['dir' => $dir]);
              }
  
              $dirItemCollection[] = $dirItem;
          }
  
          return $dirItemCollection;
      }
code_tokens: public function getAll ( LibraryType $ library , string $ dir = '/' ) { $ clippedBaseUri = $ this -> clipUri ( $ this -> client -> getConfig ( 'base_uri' ) ) ; $ response = $ this -> client -> request ( 'GET' , $ clippedBaseUri . '/repos/' . $ library -> id . '/dir/' , [ 'query' => [ 'p' => $ dir ] , ] ) ; $ json = json_decode ( ( string ) $ response -> getBody ( ) ) ; $ dirItemCollection = [ ] ; foreach ( $ json as $ dirItemJson ) { $ dirItem = ( new DirectoryItem ) -> fromJson ( $ dirItemJson ) ; // if dirItem has no value for "dir", set it here if ( $ dirItem -> dir === '/' ) { $ dirItem = $ dirItem -> fromArray ( [ 'dir' => $ dir ] ) ; } $ dirItemCollection [ ] = $ dirItem ; } return $ dirItemCollection ; }
docstring: Get all items of a directory in a library
  
  @param LibraryType $library Library type
  @param string      $dir     Directory path
  
  @return DirectoryItem[]
  @throws \Exception
  @throws \GuzzleHttp\Exception\GuzzleException
docstring_tokens: Get all items of a directory in a library