diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3f1966c715..2caf756d5a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,7 +53,7 @@ jobs: strategy: fail-fast: false matrix: - php-versions: [ '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2' ] + php-versions: [ '7.4', '8.0', '8.1', '8.2' ] coverage: [ 'xdebug' ] streaming: [ false ] include: diff --git a/.gitignore b/.gitignore index f287cca1af..a19fa48a3d 100644 --- a/.gitignore +++ b/.gitignore @@ -37,4 +37,4 @@ build.properties docs/api docs/wikidocs -.php_cs.cache +.php-cs-fixer.cache diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php new file mode 100644 index 0000000000..3f78aae014 --- /dev/null +++ b/.php-cs-fixer.dist.php @@ -0,0 +1,15 @@ +getFinder() + ->exclude('vendor') + ->in(__DIR__) + ->append([ + __FILE__, + ]); +$config->setRules([ + '@PSR1' => true, + '@Symfony' => true, +]); + +return $config; \ No newline at end of file diff --git a/.php_cs.dist b/.php_cs.dist deleted file mode 100644 index c5c78a971d..0000000000 --- a/.php_cs.dist +++ /dev/null @@ -1,12 +0,0 @@ -getFinder() - ->exclude('vendor') - ->in(__DIR__); -$config->setRules([ - '@PSR1' => true, - '@Symfony' => true -]); - -return $config; \ No newline at end of file diff --git a/composer.json b/composer.json index 4293408793..c011715cd1 100644 --- a/composer.json +++ b/composer.json @@ -14,12 +14,12 @@ } ], "require": { - "php": "^7.1.0 || ^8.0", - "sabre/vobject": "^4.2.1", - "sabre/event" : "^5.0", - "sabre/xml" : "^2.0.1", - "sabre/http" : "^5.0.5", - "sabre/uri" : "^2.0", + "php": "^7.4 || ^8.0", + "sabre/vobject": "^4.5.2", + "sabre/event" : "^6.0", + "sabre/xml" : "^3.0 || ^4.0", + "sabre/http" : "^6.0 || ^7.0", + "sabre/uri" : "^2.3 || ^3.0", "ext-dom": "*", "ext-pcre": "*", "ext-spl": "*", @@ -33,10 +33,10 @@ "ext-json": "*" }, "require-dev" : { - "friendsofphp/php-cs-fixer": "^2.17.1", - "phpstan/phpstan": "^0.12", - "phpunit/phpunit" : "^7.5 || ^8.5 || ^9.0", - "monolog/monolog": "^1.18" + "friendsofphp/php-cs-fixer": "^3.14", + "phpstan/phpstan": "^1.9", + "phpunit/phpunit" : "^9.0", + "monolog/monolog": "^2.8" }, "suggest" : { "ext-curl" : "*", diff --git a/lib/CalDAV/Xml/Notification/Invite.php b/lib/CalDAV/Xml/Notification/Invite.php index 2dbb0f4984..71ccf49b15 100644 --- a/lib/CalDAV/Xml/Notification/Invite.php +++ b/lib/CalDAV/Xml/Notification/Invite.php @@ -182,7 +182,7 @@ public function __construct(array $values) * * If you are opening new elements, you must also close them again. */ - public function xmlSerialize(Writer $writer) + public function xmlSerialize(Writer $writer): void { $writer->writeElement('{'.CalDAV\Plugin::NS_CALENDARSERVER.'}invite-notification'); } diff --git a/lib/CalDAV/Xml/Notification/InviteReply.php b/lib/CalDAV/Xml/Notification/InviteReply.php index dbdba3b027..60bd0015bb 100644 --- a/lib/CalDAV/Xml/Notification/InviteReply.php +++ b/lib/CalDAV/Xml/Notification/InviteReply.php @@ -131,7 +131,7 @@ public function __construct(array $values) * * If you are opening new elements, you must also close them again. */ - public function xmlSerialize(Writer $writer) + public function xmlSerialize(Writer $writer): void { $writer->writeElement('{'.CalDAV\Plugin::NS_CALENDARSERVER.'}invite-reply'); } diff --git a/lib/CalDAV/Xml/Notification/SystemStatus.php b/lib/CalDAV/Xml/Notification/SystemStatus.php index 6d196b30c6..666f8f4c5e 100644 --- a/lib/CalDAV/Xml/Notification/SystemStatus.php +++ b/lib/CalDAV/Xml/Notification/SystemStatus.php @@ -91,7 +91,7 @@ public function __construct($id, $etag, $type = self::TYPE_HIGH, $description = * Important note 2: If you are writing any new elements, you are also * responsible for closing them. */ - public function xmlSerialize(Writer $writer) + public function xmlSerialize(Writer $writer): void { switch ($this->type) { case self::TYPE_LOW: diff --git a/lib/CalDAV/Xml/Property/AllowedSharingModes.php b/lib/CalDAV/Xml/Property/AllowedSharingModes.php index 58acb6d540..589f1be3c0 100644 --- a/lib/CalDAV/Xml/Property/AllowedSharingModes.php +++ b/lib/CalDAV/Xml/Property/AllowedSharingModes.php @@ -69,7 +69,7 @@ public function __construct($canBeShared, $canBePublished) * * If you are opening new elements, you must also close them again. */ - public function xmlSerialize(Writer $writer) + public function xmlSerialize(Writer $writer): void { if ($this->canBeShared) { $writer->writeElement('{'.Plugin::NS_CALENDARSERVER.'}can-be-shared'); diff --git a/lib/CalDAV/Xml/Property/EmailAddressSet.php b/lib/CalDAV/Xml/Property/EmailAddressSet.php index 84f7ae02f1..0348649b4c 100644 --- a/lib/CalDAV/Xml/Property/EmailAddressSet.php +++ b/lib/CalDAV/Xml/Property/EmailAddressSet.php @@ -62,7 +62,7 @@ public function getValue() * * If you are opening new elements, you must also close them again. */ - public function xmlSerialize(Writer $writer) + public function xmlSerialize(Writer $writer): void { foreach ($this->emails as $email) { $writer->writeElement('{http://calendarserver.org/ns/}email-address', $email); diff --git a/lib/CalDAV/Xml/Property/Invite.php b/lib/CalDAV/Xml/Property/Invite.php index c389ca827d..ea5e505456 100644 --- a/lib/CalDAV/Xml/Property/Invite.php +++ b/lib/CalDAV/Xml/Property/Invite.php @@ -68,7 +68,7 @@ public function getValue() * * If you are opening new elements, you must also close them again. */ - public function xmlSerialize(Writer $writer) + public function xmlSerialize(Writer $writer): void { $cs = '{'.Plugin::NS_CALENDARSERVER.'}'; diff --git a/lib/CalDAV/Xml/Property/ScheduleCalendarTransp.php b/lib/CalDAV/Xml/Property/ScheduleCalendarTransp.php index 1595220250..45e290bc01 100644 --- a/lib/CalDAV/Xml/Property/ScheduleCalendarTransp.php +++ b/lib/CalDAV/Xml/Property/ScheduleCalendarTransp.php @@ -77,7 +77,7 @@ public function getValue() * * If you are opening new elements, you must also close them again. */ - public function xmlSerialize(Writer $writer) + public function xmlSerialize(Writer $writer): void { switch ($this->value) { case self::TRANSPARENT: diff --git a/lib/CalDAV/Xml/Property/SupportedCalendarComponentSet.php b/lib/CalDAV/Xml/Property/SupportedCalendarComponentSet.php index d86e7b77c4..3fe03f4f2d 100644 --- a/lib/CalDAV/Xml/Property/SupportedCalendarComponentSet.php +++ b/lib/CalDAV/Xml/Property/SupportedCalendarComponentSet.php @@ -68,7 +68,7 @@ public function getValue() * * If you are opening new elements, you must also close them again. */ - public function xmlSerialize(Writer $writer) + public function xmlSerialize(Writer $writer): void { foreach ($this->components as $component) { $writer->startElement('{'.Plugin::NS_CALDAV.'}comp'); diff --git a/lib/CalDAV/Xml/Property/SupportedCalendarData.php b/lib/CalDAV/Xml/Property/SupportedCalendarData.php index 5b08933058..1ab646d090 100644 --- a/lib/CalDAV/Xml/Property/SupportedCalendarData.php +++ b/lib/CalDAV/Xml/Property/SupportedCalendarData.php @@ -40,7 +40,7 @@ class SupportedCalendarData implements XmlSerializable * * If you are opening new elements, you must also close them again. */ - public function xmlSerialize(Writer $writer) + public function xmlSerialize(Writer $writer): void { $writer->startElement('{'.Plugin::NS_CALDAV.'}calendar-data'); $writer->writeAttributes([ diff --git a/lib/CalDAV/Xml/Property/SupportedCollationSet.php b/lib/CalDAV/Xml/Property/SupportedCollationSet.php index c5ffeee385..af73a02ffc 100644 --- a/lib/CalDAV/Xml/Property/SupportedCollationSet.php +++ b/lib/CalDAV/Xml/Property/SupportedCollationSet.php @@ -39,7 +39,7 @@ class SupportedCollationSet implements XmlSerializable * * If you are opening new elements, you must also close them again. */ - public function xmlSerialize(Writer $writer) + public function xmlSerialize(Writer $writer): void { $collations = [ 'i;ascii-casemap', diff --git a/lib/CardDAV/Xml/Property/SupportedAddressData.php b/lib/CardDAV/Xml/Property/SupportedAddressData.php index fe5f976a03..a912724bf9 100644 --- a/lib/CardDAV/Xml/Property/SupportedAddressData.php +++ b/lib/CardDAV/Xml/Property/SupportedAddressData.php @@ -63,7 +63,7 @@ public function __construct(array $supportedData = null) * * If you are opening new elements, you must also close them again. */ - public function xmlSerialize(Writer $writer) + public function xmlSerialize(Writer $writer): void { foreach ($this->supportedData as $supported) { $writer->startElement('{'.Plugin::NS_CARDDAV.'}address-data-type'); diff --git a/lib/CardDAV/Xml/Property/SupportedCollationSet.php b/lib/CardDAV/Xml/Property/SupportedCollationSet.php index b19eddd9c2..d8ca982aa7 100644 --- a/lib/CardDAV/Xml/Property/SupportedCollationSet.php +++ b/lib/CardDAV/Xml/Property/SupportedCollationSet.php @@ -35,7 +35,7 @@ class SupportedCollationSet implements XmlSerializable * * If you are opening new elements, you must also close them again. */ - public function xmlSerialize(Writer $writer) + public function xmlSerialize(Writer $writer): void { foreach (['i;ascii-casemap', 'i;octet', 'i;unicode-casemap'] as $coll) { $writer->writeElement('{urn:ietf:params:xml:ns:carddav}supported-collation', $coll); diff --git a/lib/DAV/CorePlugin.php b/lib/DAV/CorePlugin.php index dbd8976b17..1d8517c10e 100644 --- a/lib/DAV/CorePlugin.php +++ b/lib/DAV/CorePlugin.php @@ -548,7 +548,7 @@ public function httpMkcol(RequestInterface $request, ResponseInterface $response if (!isset($properties['{DAV:}resourcetype'])) { throw new Exception\BadRequest('The mkcol request must include a {DAV:}resourcetype property'); } - $resourceType = $properties['{DAV:}resourcetype']->getValue(); + $resourceType = $properties['{DAV:}resourcetype']; unset($properties['{DAV:}resourcetype']); } else { $properties = []; diff --git a/lib/DAV/Xml/Element/Prop.php b/lib/DAV/Xml/Element/Prop.php index 9c214792f1..5fbb0e269c 100644 --- a/lib/DAV/Xml/Element/Prop.php +++ b/lib/DAV/Xml/Element/Prop.php @@ -100,6 +100,9 @@ private static function parseCurrentElement(Reader $reader) } } else { $value = Complex::xmlDeserialize($reader); + if (!($value instanceof Complex)) { + $value = $value->getXml(); + } } return [ diff --git a/lib/DAV/Xml/Element/Response.php b/lib/DAV/Xml/Element/Response.php index 79f06a09bf..10e63fdbc5 100644 --- a/lib/DAV/Xml/Element/Response.php +++ b/lib/DAV/Xml/Element/Response.php @@ -110,7 +110,7 @@ public function getResponseProperties() * Important note 2: If you are writing any new elements, you are also * responsible for closing them. */ - public function xmlSerialize(Writer $writer) + public function xmlSerialize(Writer $writer): void { if ($status = $this->getHTTPStatus()) { $writer->writeElement('{DAV:}status', 'HTTP/1.1 '.$status.' '.\Sabre\HTTP\Response::$statusCodes[$status]); diff --git a/lib/DAV/Xml/Element/Sharee.php b/lib/DAV/Xml/Element/Sharee.php index 33564d8f24..79d6aa90db 100644 --- a/lib/DAV/Xml/Element/Sharee.php +++ b/lib/DAV/Xml/Element/Sharee.php @@ -112,7 +112,7 @@ public function __construct(array $properties = []) * * If you are opening new elements, you must also close them again. */ - public function xmlSerialize(Writer $writer) + public function xmlSerialize(Writer $writer): void { $writer->write([ new Href($this->href), diff --git a/lib/DAV/Xml/Property/Complex.php b/lib/DAV/Xml/Property/Complex.php index 787d30d954..24ab464077 100644 --- a/lib/DAV/Xml/Property/Complex.php +++ b/lib/DAV/Xml/Property/Complex.php @@ -39,7 +39,7 @@ class Complex extends XmlFragment * * @return mixed */ - public static function xmlDeserialize(Reader $reader) + public static function xmlDeserialize(Reader $reader): XmlFragment { $xml = $reader->readInnerXml(); @@ -47,7 +47,7 @@ public static function xmlDeserialize(Reader $reader) // Easy! $reader->next(); - return null; + return new XmlFragment(''); } // Now we have a copy of the inner xml, we need to traverse it to get // all the strings. If there's no non-string data, we just return the @@ -81,7 +81,9 @@ public static function xmlDeserialize(Reader $reader) return $new; } else { - return $text; + $new = new XmlFragment($text); + + return $new; } } } diff --git a/lib/DAV/Xml/Property/GetLastModified.php b/lib/DAV/Xml/Property/GetLastModified.php index efc15c293a..0a1b7f800e 100644 --- a/lib/DAV/Xml/Property/GetLastModified.php +++ b/lib/DAV/Xml/Property/GetLastModified.php @@ -69,7 +69,7 @@ public function getTime() * Important note 2: If you are writing any new elements, you are also * responsible for closing them. */ - public function xmlSerialize(Writer $writer) + public function xmlSerialize(Writer $writer): void { $writer->write( HTTP\toDate($this->time) diff --git a/lib/DAV/Xml/Property/Href.php b/lib/DAV/Xml/Property/Href.php index f88ce814ad..898a4e2328 100644 --- a/lib/DAV/Xml/Property/Href.php +++ b/lib/DAV/Xml/Property/Href.php @@ -85,7 +85,7 @@ public function getHrefs() * * If you are opening new elements, you must also close them again. */ - public function xmlSerialize(Writer $writer) + public function xmlSerialize(Writer $writer): void { foreach ($this->getHrefs() as $href) { $href = Uri\resolve($writer->contextUri, $href); diff --git a/lib/DAV/Xml/Property/Invite.php b/lib/DAV/Xml/Property/Invite.php index e3f0a611bf..a6654dd398 100644 --- a/lib/DAV/Xml/Property/Invite.php +++ b/lib/DAV/Xml/Property/Invite.php @@ -57,7 +57,7 @@ public function __construct(array $sharees) * * If you are opening new elements, you must also close them again. */ - public function xmlSerialize(Writer $writer) + public function xmlSerialize(Writer $writer): void { foreach ($this->sharees as $sharee) { $writer->writeElement('{DAV:}sharee', $sharee); diff --git a/lib/DAV/Xml/Property/LockDiscovery.php b/lib/DAV/Xml/Property/LockDiscovery.php index ec4cbc0c6c..7fdc8ef591 100644 --- a/lib/DAV/Xml/Property/LockDiscovery.php +++ b/lib/DAV/Xml/Property/LockDiscovery.php @@ -63,7 +63,7 @@ public function __construct($locks) * Important note 2: If you are writing any new elements, you are also * responsible for closing them. */ - public function xmlSerialize(Writer $writer) + public function xmlSerialize(Writer $writer): void { foreach ($this->locks as $lock) { $writer->startElement('{DAV:}activelock'); diff --git a/lib/DAV/Xml/Property/ResourceType.php b/lib/DAV/Xml/Property/ResourceType.php index 75ddcba3fe..6f2df58f68 100644 --- a/lib/DAV/Xml/Property/ResourceType.php +++ b/lib/DAV/Xml/Property/ResourceType.php @@ -72,31 +72,6 @@ public function add($type) $this->value = array_unique($this->value); } - /** - * The deserialize method is called during xml parsing. - * - * This method is called statically, this is because in theory this method - * may be used as a type of constructor, or factory method. - * - * Often you want to return an instance of the current class, but you are - * free to return other data as well. - * - * Important note 2: You are responsible for advancing the reader to the - * next element. Not doing anything will result in a never-ending loop. - * - * If you just want to skip parsing for this element altogether, you can - * just call $reader->next(); - * - * $reader->parseInnerTree() will parse the entire sub-tree, and advance to - * the next element. - * - * @return mixed - */ - public static function xmlDeserialize(Reader $reader) - { - return new self(parent::xmlDeserialize($reader)); - } - /** * Generate html representation for this value. * diff --git a/lib/DAV/Xml/Property/ShareAccess.php b/lib/DAV/Xml/Property/ShareAccess.php index fdd55558c9..878e3eeca3 100644 --- a/lib/DAV/Xml/Property/ShareAccess.php +++ b/lib/DAV/Xml/Property/ShareAccess.php @@ -72,7 +72,7 @@ public function getValue() * * If you are opening new elements, you must also close them again. */ - public function xmlSerialize(Writer $writer) + public function xmlSerialize(Writer $writer): void { switch ($this->value) { case SharingPlugin::ACCESS_NOTSHARED: diff --git a/lib/DAV/Xml/Property/SupportedLock.php b/lib/DAV/Xml/Property/SupportedLock.php index 100829c60a..fcbe2fa459 100644 --- a/lib/DAV/Xml/Property/SupportedLock.php +++ b/lib/DAV/Xml/Property/SupportedLock.php @@ -38,7 +38,7 @@ class SupportedLock implements XmlSerializable * * If you are opening new elements, you must also close them again. */ - public function xmlSerialize(Writer $writer) + public function xmlSerialize(Writer $writer): void { $writer->writeElement('{DAV:}lockentry', [ '{DAV:}lockscope' => ['{DAV:}exclusive' => null], diff --git a/lib/DAV/Xml/Property/SupportedMethodSet.php b/lib/DAV/Xml/Property/SupportedMethodSet.php index 6344010932..95d2c29ac6 100644 --- a/lib/DAV/Xml/Property/SupportedMethodSet.php +++ b/lib/DAV/Xml/Property/SupportedMethodSet.php @@ -82,7 +82,7 @@ public function has($methodName) * * If you are opening new elements, you must also close them again. */ - public function xmlSerialize(Writer $writer) + public function xmlSerialize(Writer $writer): void { foreach ($this->getValue() as $val) { $writer->startElement('{DAV:}supported-method'); diff --git a/lib/DAV/Xml/Property/SupportedReportSet.php b/lib/DAV/Xml/Property/SupportedReportSet.php index 0b4990e961..35e1614423 100644 --- a/lib/DAV/Xml/Property/SupportedReportSet.php +++ b/lib/DAV/Xml/Property/SupportedReportSet.php @@ -110,7 +110,7 @@ public function has($reportName) * * If you are opening new elements, you must also close them again. */ - public function xmlSerialize(Writer $writer) + public function xmlSerialize(Writer $writer): void { foreach ($this->getValue() as $val) { $writer->startElement('{DAV:}supported-report'); diff --git a/lib/DAV/Xml/Request/PropPatch.php b/lib/DAV/Xml/Request/PropPatch.php index 4a27095025..a1d903c378 100644 --- a/lib/DAV/Xml/Request/PropPatch.php +++ b/lib/DAV/Xml/Request/PropPatch.php @@ -46,7 +46,7 @@ class PropPatch implements Element * * If you are opening new elements, you must also close them again. */ - public function xmlSerialize(Writer $writer) + public function xmlSerialize(Writer $writer): void { foreach ($this->properties as $propertyName => $propertyValue) { if (is_null($propertyValue)) { diff --git a/lib/DAV/Xml/Response/MultiStatus.php b/lib/DAV/Xml/Response/MultiStatus.php index e824cda429..8f9d45c80f 100644 --- a/lib/DAV/Xml/Response/MultiStatus.php +++ b/lib/DAV/Xml/Response/MultiStatus.php @@ -81,7 +81,7 @@ public function getSyncToken() * Important note 2: If you are writing any new elements, you are also * responsible for closing them. */ - public function xmlSerialize(Writer $writer) + public function xmlSerialize(Writer $writer): void { foreach ($this->getResponses() as $response) { $writer->writeElement('{DAV:}response', $response); diff --git a/lib/DAV/Xml/Service.php b/lib/DAV/Xml/Service.php index 4406b022d0..7c007d6929 100644 --- a/lib/DAV/Xml/Service.php +++ b/lib/DAV/Xml/Service.php @@ -19,7 +19,7 @@ class Service extends \Sabre\Xml\Service * For instance, this list may contain an entry `{DAV:}propfind` that would * be mapped to Sabre\DAV\Xml\Request\PropFind */ - public $elementMap = [ + public array $elementMap = [ '{DAV:}multistatus' => 'Sabre\\DAV\\Xml\\Response\\MultiStatus', '{DAV:}response' => 'Sabre\\DAV\\Xml\\Element\\Response', @@ -40,7 +40,7 @@ class Service extends \Sabre\Xml\Service * * @var array */ - public $namespaceMap = [ + public array $namespaceMap = [ 'DAV:' => 'd', 'http://sabredav.org/ns' => 's', ]; diff --git a/lib/DAVACL/Xml/Property/Acl.php b/lib/DAVACL/Xml/Property/Acl.php index c6e236dc59..086d123037 100644 --- a/lib/DAVACL/Xml/Property/Acl.php +++ b/lib/DAVACL/Xml/Property/Acl.php @@ -92,7 +92,7 @@ public function getPrivileges() * * If you are opening new elements, you must also close them again. */ - public function xmlSerialize(Writer $writer) + public function xmlSerialize(Writer $writer): void { foreach ($this->privileges as $ace) { $this->serializeAce($writer, $ace); diff --git a/lib/DAVACL/Xml/Property/AclRestrictions.php b/lib/DAVACL/Xml/Property/AclRestrictions.php index b5629c8096..f93f415a24 100644 --- a/lib/DAVACL/Xml/Property/AclRestrictions.php +++ b/lib/DAVACL/Xml/Property/AclRestrictions.php @@ -34,7 +34,7 @@ class AclRestrictions implements XmlSerializable * * If you are opening new elements, you must also close them again. */ - public function xmlSerialize(Writer $writer) + public function xmlSerialize(Writer $writer): void { $writer->writeElement('{DAV:}grant-only'); $writer->writeElement('{DAV:}no-invert'); diff --git a/lib/DAVACL/Xml/Property/CurrentUserPrivilegeSet.php b/lib/DAVACL/Xml/Property/CurrentUserPrivilegeSet.php index e38a45c61e..4a7ad25b48 100644 --- a/lib/DAVACL/Xml/Property/CurrentUserPrivilegeSet.php +++ b/lib/DAVACL/Xml/Property/CurrentUserPrivilegeSet.php @@ -55,7 +55,7 @@ public function __construct(array $privileges) * * If you are opening new elements, you must also close them again. */ - public function xmlSerialize(Writer $writer) + public function xmlSerialize(Writer $writer): void { foreach ($this->privileges as $privName) { $writer->startElement('{DAV:}privilege'); diff --git a/lib/DAVACL/Xml/Property/Principal.php b/lib/DAVACL/Xml/Property/Principal.php index 52092128f3..e19ad61744 100644 --- a/lib/DAVACL/Xml/Property/Principal.php +++ b/lib/DAVACL/Xml/Property/Principal.php @@ -99,7 +99,7 @@ public function getType() * * If you are opening new elements, you must also close them again. */ - public function xmlSerialize(Writer $writer) + public function xmlSerialize(Writer $writer): void { switch ($this->type) { case self::UNAUTHENTICATED: diff --git a/lib/DAVACL/Xml/Property/SupportedPrivilegeSet.php b/lib/DAVACL/Xml/Property/SupportedPrivilegeSet.php index 6e7514bd95..b965f3c078 100644 --- a/lib/DAVACL/Xml/Property/SupportedPrivilegeSet.php +++ b/lib/DAVACL/Xml/Property/SupportedPrivilegeSet.php @@ -66,7 +66,7 @@ public function getValue() * * If you are opening new elements, you must also close them again. */ - public function xmlSerialize(Writer $writer) + public function xmlSerialize(Writer $writer): void { $this->serializePriv($writer, '{DAV:}all', ['aggregates' => $this->privileges]); } diff --git a/tests/Sabre/DAV/ClientMock.php b/tests/Sabre/DAV/ClientMock.php index 7d787744a1..ab4675f8b9 100644 --- a/tests/Sabre/DAV/ClientMock.php +++ b/tests/Sabre/DAV/ClientMock.php @@ -13,7 +13,7 @@ class ClientMock extends Client public $response; public $url; - public $curlSettings; + public array $curlSettings; /** * Just making this method public. diff --git a/tests/Sabre/DAV/MockLogger.php b/tests/Sabre/DAV/MockLogger.php index 17e2f1dd9d..28e744f961 100644 --- a/tests/Sabre/DAV/MockLogger.php +++ b/tests/Sabre/DAV/MockLogger.php @@ -24,7 +24,7 @@ class MockLogger extends AbstractLogger * @param mixed $level * @param string $message */ - public function log($level, $message, array $context = []) + public function log($level, $message, array $context = []): void { $this->logs[] = [ $level, diff --git a/tests/Sabre/HTTP/ResponseMock.php b/tests/Sabre/HTTP/ResponseMock.php index c5357928a3..0d968e178f 100644 --- a/tests/Sabre/HTTP/ResponseMock.php +++ b/tests/Sabre/HTTP/ResponseMock.php @@ -19,5 +19,5 @@ class ResponseMock extends Response * Making these public. */ public $body; - public $status; + public int $status; } diff --git a/tests/Sabre/HTTP/SapiMock.php b/tests/Sabre/HTTP/SapiMock.php index 4860030d01..c885078324 100644 --- a/tests/Sabre/HTTP/SapiMock.php +++ b/tests/Sabre/HTTP/SapiMock.php @@ -20,7 +20,7 @@ class SapiMock extends Sapi /** * Overriding this so nothing is ever echo'd. */ - public static function sendResponse(ResponseInterface $response) + public static function sendResponse(ResponseInterface $response): void { ++self::$sent; } diff --git a/tests/phpunit.xml b/tests/phpunit.xml index b836b59964..e788370180 100644 --- a/tests/phpunit.xml +++ b/tests/phpunit.xml @@ -1,39 +1,24 @@ - - + + + + ../lib/ + + - - ../vendor/sabre/http/tests/HTTP - - - - Sabre/DAV - - - Sabre/DAVACL - - - Sabre/CalDAV - - - Sabre/CardDAV - + + Sabre/DAV + + + Sabre/DAVACL + + + Sabre/CalDAV + + + Sabre/CardDAV + - - - - ../lib/ - - -