Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade dependencies and set minimal PHP version to 7.4 #1448

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ build.properties
docs/api
docs/wikidocs

.php_cs.cache
.php-cs-fixer.cache
15 changes: 15 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

$config = new PhpCsFixer\Config();
$config->getFinder()
->exclude('vendor')
->in(__DIR__)
->append([
__FILE__,
]);
$config->setRules([
'@PSR1' => true,
'@Symfony' => true,
]);

return $config;
12 changes: 0 additions & 12 deletions .php_cs.dist

This file was deleted.

20 changes: 10 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "*",
Expand All @@ -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" : "*",
Expand Down
2 changes: 1 addition & 1 deletion lib/CalDAV/Xml/Notification/Invite.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down
2 changes: 1 addition & 1 deletion lib/CalDAV/Xml/Notification/InviteReply.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down
2 changes: 1 addition & 1 deletion lib/CalDAV/Xml/Notification/SystemStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion lib/CalDAV/Xml/Property/AllowedSharingModes.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion lib/CalDAV/Xml/Property/EmailAddressSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion lib/CalDAV/Xml/Property/Invite.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.'}';

Expand Down
2 changes: 1 addition & 1 deletion lib/CalDAV/Xml/Property/ScheduleCalendarTransp.php
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion lib/CalDAV/Xml/Property/SupportedCalendarComponentSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion lib/CalDAV/Xml/Property/SupportedCalendarData.php
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand Down
2 changes: 1 addition & 1 deletion lib/CalDAV/Xml/Property/SupportedCollationSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion lib/CardDAV/Xml/Property/SupportedAddressData.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion lib/CardDAV/Xml/Property/SupportedCollationSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion lib/DAV/CorePlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand Down
3 changes: 3 additions & 0 deletions lib/DAV/Xml/Element/Prop.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ private static function parseCurrentElement(Reader $reader)
}
} else {
$value = Complex::xmlDeserialize($reader);
if (!($value instanceof Complex)) {
$value = $value->getXml();
}
}

return [
Expand Down
2 changes: 1 addition & 1 deletion lib/DAV/Xml/Element/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down
2 changes: 1 addition & 1 deletion lib/DAV/Xml/Element/Sharee.php
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
8 changes: 5 additions & 3 deletions lib/DAV/Xml/Property/Complex.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ class Complex extends XmlFragment
*
* @return mixed
*/
public static function xmlDeserialize(Reader $reader)
public static function xmlDeserialize(Reader $reader): XmlFragment
{
$xml = $reader->readInnerXml();

if (Reader::ELEMENT === $reader->nodeType && $reader->isEmptyElement) {
// 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
Expand Down Expand Up @@ -81,7 +81,9 @@ public static function xmlDeserialize(Reader $reader)

return $new;
} else {
return $text;
$new = new XmlFragment($text);

return $new;
}
}
}
2 changes: 1 addition & 1 deletion lib/DAV/Xml/Property/GetLastModified.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion lib/DAV/Xml/Property/Href.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion lib/DAV/Xml/Property/Invite.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion lib/DAV/Xml/Property/LockDiscovery.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
25 changes: 0 additions & 25 deletions lib/DAV/Xml/Property/ResourceType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
2 changes: 1 addition & 1 deletion lib/DAV/Xml/Property/ShareAccess.php
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion lib/DAV/Xml/Property/SupportedLock.php
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
2 changes: 1 addition & 1 deletion lib/DAV/Xml/Property/SupportedMethodSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion lib/DAV/Xml/Property/SupportedReportSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion lib/DAV/Xml/Request/PropPatch.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
2 changes: 1 addition & 1 deletion lib/DAV/Xml/Response/MultiStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions lib/DAV/Xml/Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',

Expand All @@ -40,7 +40,7 @@ class Service extends \Sabre\Xml\Service
*
* @var array
*/
public $namespaceMap = [
public array $namespaceMap = [
'DAV:' => 'd',
'http://sabredav.org/ns' => 's',
];
Expand Down
Loading