original_string: public function listFolder(string $path, bool $recursive = false) : array
  	{
  		$path = $this->normalizePath($path);
  			
  		$requestUrl = $this->siteUrl.'/sites/'.$this->siteName.'/_api/Web/GetFolderByServerRelativeUrl(\''.$this->folderPath.$path.'\')/Folders';
  		
  		$options = [
  			'headers' => $this->requestHeaders,
  		];
  			
  		$response = $this->send('GET', $requestUrl, $options);
  			
  		$folders = json_decode($response->getBody())->d ?? ['results' => []];
  			
  		// Making sure we convert the object to an array
  		if (!is_array($folders)) {
  			$folders = json_decode(json_encode($folders), true);
  		}
  			
  		return $folders['results'];
  	}
code: public function listFolder(string $path, bool $recursive = false) : array
  	{
  		$path = $this->normalizePath($path);
  			
  		$requestUrl = $this->siteUrl.'/sites/'.$this->siteName.'/_api/Web/GetFolderByServerRelativeUrl(\''.$this->folderPath.$path.'\')/Folders';
  		
  		$options = [
  			'headers' => $this->requestHeaders,
  		];
  			
  		$response = $this->send('GET', $requestUrl, $options);
  			
  		$folders = json_decode($response->getBody())->d ?? ['results' => []];
  			
  		// Making sure we convert the object to an array
  		if (!is_array($folders)) {
  			$folders = json_decode(json_encode($folders), true);
  		}
  			
  		return $folders['results'];
  	}
code_tokens: public function listFolder ( string $ path , bool $ recursive = false ) : array { $ path = $ this -> normalizePath ( $ path ) ; $ requestUrl = $ this -> siteUrl . '/sites/' . $ this -> siteName . '/_api/Web/GetFolderByServerRelativeUrl(\'' . $ this -> folderPath . $ path . '\')/Folders' ; $ options = [ 'headers' => $ this -> requestHeaders , ] ; $ response = $ this -> send ( 'GET' , $ requestUrl , $ options ) ; $ folders = json_decode ( $ response -> getBody ( ) ) -> d ?? [ 'results' => [ ] ] ; // Making sure we convert the object to an array if ( ! is_array ( $ folders ) ) { $ folders = json_decode ( json_encode ( $ folders ) , true ) ; } return $ folders [ 'results' ] ; }
docstring: Returns the contents of a folder.
docstring_tokens: Returns the contents of a folder .