original_string: public function subdirectories($path = null, $fullPath = true)
      {
          if (!$path) {
              $path = $this->path;
          }
          $subdirectories = [];
  
          try {
              $iterator = new DirectoryIterator($path);
          } catch (Exception $e) {
              return [];
          }
  
          foreach ($iterator as $item) {
              if (!$item->isDir() || $item->isDot()) {
                  continue;
              }
              $subdirectories[] = $fullPath ? $item->getRealPath() : $item->getFilename();
          }
  
          return $subdirectories;
      }
code: public function subdirectories($path = null, $fullPath = true)
      {
          if (!$path) {
              $path = $this->path;
          }
          $subdirectories = [];
  
          try {
              $iterator = new DirectoryIterator($path);
          } catch (Exception $e) {
              return [];
          }
  
          foreach ($iterator as $item) {
              if (!$item->isDir() || $item->isDot()) {
                  continue;
              }
              $subdirectories[] = $fullPath ? $item->getRealPath() : $item->getFilename();
          }
  
          return $subdirectories;
      }
code_tokens: public function subdirectories ( $ path = null , $ fullPath = true ) { if ( ! $ path ) { $ path = $ this -> path ; } $ subdirectories = [ ] ; try { $ iterator = new DirectoryIterator ( $ path ) ; } catch ( Exception $ e ) { return [ ] ; } foreach ( $ iterator as $ item ) { if ( ! $ item -> isDir ( ) || $ item -> isDot ( ) ) { continue ; } $ subdirectories [ ] = $ fullPath ? $ item -> getRealPath ( ) : $ item -> getFilename ( ) ; } return $ subdirectories ; }
docstring: Returns an array of subdirectories for the provided or current path.
  
  @param string|null $path The directory path to get subdirectories for.
  @param bool $fullPath Whether to return the full path or only the directory name.
  @return array Array of subdirectories for the provided or current path.
docstring_tokens: Returns an array of subdirectories for the provided or current path .