diff options
author | Mario <mario@mariovavti.com> | 2019-11-10 12:49:51 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2019-11-10 14:10:03 +0100 |
commit | 580c3f4ffe9608d2beb56d418c68b3b112420e76 (patch) | |
tree | 82335d01179ac361d3f547a4b8e8c598d302e9f3 /vendor/sabre/dav/lib/DAV/Browser/PropFindAll.php | |
parent | d22766f458a8539a40a57f3946459a9be1f21cd6 (diff) | |
download | volse-hubzilla-580c3f4ffe9608d2beb56d418c68b3b112420e76.tar.gz volse-hubzilla-580c3f4ffe9608d2beb56d418c68b3b112420e76.tar.bz2 volse-hubzilla-580c3f4ffe9608d2beb56d418c68b3b112420e76.zip |
another bulk of composer updates
(cherry picked from commit 6685381fd8db507493c3d7c1793f8c05c681bbce)
Diffstat (limited to 'vendor/sabre/dav/lib/DAV/Browser/PropFindAll.php')
-rw-r--r-- | vendor/sabre/dav/lib/DAV/Browser/PropFindAll.php | 54 |
1 files changed, 25 insertions, 29 deletions
diff --git a/vendor/sabre/dav/lib/DAV/Browser/PropFindAll.php b/vendor/sabre/dav/lib/DAV/Browser/PropFindAll.php index c14b7f2f9..34702bdd8 100644 --- a/vendor/sabre/dav/lib/DAV/Browser/PropFindAll.php +++ b/vendor/sabre/dav/lib/DAV/Browser/PropFindAll.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Sabre\DAV\Browser; use Sabre\DAV\PropFind; @@ -12,17 +14,16 @@ use Sabre\DAV\PropFind; * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ -class PropFindAll extends PropFind { - +class PropFindAll extends PropFind +{ /** - * Creates the PROPFIND object + * Creates the PROPFIND object. * * @param string $path */ - function __construct($path) { - + public function __construct($path) + { parent::__construct($path, []); - } /** @@ -44,11 +45,10 @@ class PropFindAll extends PropFind { * It's also possible to not pass a callback, but immediately pass a value * * @param string $propertyName - * @param mixed $valueOrCallBack - * @return void + * @param mixed $valueOrCallBack */ - function handle($propertyName, $valueOrCallBack) { - + public function handle($propertyName, $valueOrCallBack) + { if (is_callable($valueOrCallBack)) { $value = $valueOrCallBack(); } else { @@ -57,39 +57,36 @@ class PropFindAll extends PropFind { if (!is_null($value)) { $this->result[$propertyName] = [200, $value]; } - } /** - * Sets the value of the property + * Sets the value of the property. * * If status is not supplied, the status will default to 200 for non-null * properties, and 404 for null properties. * * @param string $propertyName - * @param mixed $value - * @param int $status - * @return void + * @param mixed $value + * @param int $status */ - function set($propertyName, $value, $status = null) { - + public function set($propertyName, $value, $status = null) + { if (is_null($status)) { $status = is_null($value) ? 404 : 200; } $this->result[$propertyName] = [$status, $value]; - } /** * Returns the current value for a property. * * @param string $propertyName + * * @return mixed */ - function get($propertyName) { - + public function get($propertyName) + { return isset($this->result[$propertyName]) ? $this->result[$propertyName][1] : null; - } /** @@ -99,12 +96,12 @@ class PropFindAll extends PropFind { * null will be returned. * * @param string $propertyName + * * @return int|null */ - function getStatus($propertyName) { - + public function getStatus($propertyName) + { return isset($this->result[$propertyName]) ? $this->result[$propertyName][0] : 404; - } /** @@ -113,11 +110,11 @@ class PropFindAll extends PropFind { * * @return array */ - function get404Properties() { - + public function get404Properties() + { $result = []; foreach ($this->result as $propertyName => $stuff) { - if ($stuff[0] === 404) { + if (404 === $stuff[0]) { $result[] = $propertyName; } } @@ -125,8 +122,7 @@ class PropFindAll extends PropFind { if (!$result) { $result[] = '{http://sabredav.org/ns}idk'; } - return $result; + return $result; } - } |