From 72548b702d67f342c80e908333e74b42ff1831ac Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Mon, 11 Dec 2023 14:39:01 +0545 Subject: [PATCH] feat: adjust client PROPFIND methods to add types --- lib/DAV/Client.php | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/lib/DAV/Client.php b/lib/DAV/Client.php index 60d2679b14..187b29ba37 100644 --- a/lib/DAV/Client.php +++ b/lib/DAV/Client.php @@ -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. @@ -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); @@ -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); @@ -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;