Skip to content

Commit

Permalink
feat: adjust client PROPFIND methods to add types
Browse files Browse the repository at this point in the history
  • Loading branch information
phil-davis committed Dec 11, 2023
1 parent add4a14 commit c08f202
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions lib/DAV/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public function __construct(array $settings)
}

/**
* Does a PROPFIND request with filtered response.
* Does a PROPFIND request with filtered response returning only available properties.
*
* The list of requested properties must be specified as an array, in clark
* notation.
Expand All @@ -191,12 +191,9 @@ public function __construct(array $settings)
* Only properties that are actually returned from the server without error will be
* returned, anything else is discarded.
*
* @param string $url
* @param int $depth
*
* @return array
* @param 1|0 $depth
*/
public function propFind($url, array $properties, $depth = 0)
public function propFind(string $url, array $properties, int $depth = 0): array
{
$result = $this->doPropFind($url, $properties, $depth);

Expand Down Expand Up @@ -235,12 +232,9 @@ public function propFind($url, array $properties, $depth = 0)
*
* All properties that are actually returned from the server are returned by this method.
*
* @param string $url
* @param int $depth
*
* @return array
* @param 1|0 $depth
*/
public function propFindUnfiltered($url, array $properties, $depth = 0)
public function propFindUnfiltered(string $url, array $properties, int $depth = 0): array
{
$result = $this->doPropFind($url, $properties, $depth);

Expand Down Expand Up @@ -269,12 +263,9 @@ public function propFindUnfiltered($url, array $properties, $depth = 0)
* The multi-level array of status and properties is formatted the same as what is
* documented for parseMultiStatus.
*
* @param string $url
* @param int $depth
*
* @return array
* @param 1|0 $depth
*/
private function doPropFind($url, array $properties, $depth = 0)
private function doPropFind(string $url, array $properties, int $depth = 0): array
{
$dom = new \DOMDocument('1.0', 'UTF-8');
$dom->formatOutput = true;
Expand Down

0 comments on commit c08f202

Please sign in to comment.