Skip to content

Commit

Permalink
Merge pull request sabre-io#1502 from sabre-io/feat/php7.4-min
Browse files Browse the repository at this point in the history
feat: use php7.4 as minimum
  • Loading branch information
phil-davis authored Nov 15, 2023
2 parents 7e40343 + 9296cf2 commit e77f38b
Show file tree
Hide file tree
Showing 172 changed files with 459 additions and 513 deletions.
6 changes: 3 additions & 3 deletions .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 Expand Up @@ -109,7 +109,7 @@ jobs:

- name: PHPUnit
if: matrix.streaming == false
run: vendor/bin/phpunit --verbose --configuration tests/phpunit.xml --coverage-clover=coverage.xml
run: vendor/bin/phpunit --verbose --configuration tests/phpunit.xml --coverage-clover=coverage.xml tests
env:
SABRE_MYSQLUSER: root
SABRE_MYSQLPASS: root
Expand All @@ -118,7 +118,7 @@ jobs:

- name: PHPUnit (with streaming)
if: matrix.streaming == true
run: vendor/bin/phpunit --verbose --configuration tests/phpunit.xml --coverage-clover=coverage.xml
run: vendor/bin/phpunit --verbose --configuration tests/phpunit.xml --coverage-clover=coverage.xml tests
env:
SABRE_MYSQLUSER: root
SABRE_MYSQLPASS: root
Expand Down
27 changes: 13 additions & 14 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,24 @@
}
],
"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.0 || ^8.0",
"ext-ctype": "*",
"ext-date": "*",
"ext-dom": "*",
"ext-iconv": "*",
"ext-json": "*",
"ext-mbstring": "*",
"ext-pcre": "*",
"ext-spl": "*",
"ext-simplexml": "*",
"ext-mbstring" : "*",
"ext-ctype" : "*",
"ext-date" : "*",
"ext-iconv" : "*",
"lib-libxml" : ">=2.7.0",
"ext-spl": "*",
"lib-libxml": ">=2.7.0",
"psr/log": "^1.0 || ^2.0 || ^3.0",
"ext-json": "*"
"sabre/event": "^6.0",
"sabre/http": "^7.0",
"sabre/vobject": "^4.5"
},
"require-dev" : {
"ext-sqlite3": "*",
"friendsofphp/php-cs-fixer": "^2.19",
"monolog/monolog": "^1.27",
"phpstan/phpstan": "^0.12 || ^1.0",
Expand Down Expand Up @@ -70,7 +69,7 @@
"php-cs-fixer fix"
],
"phpunit": [
"phpunit --configuration tests/phpunit.xml"
"phpunit --configuration tests/phpunit.xml tests"
],
"test": [
"composer phpstan",
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/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
{
/*
* Accordingly to the RFC the element looks like:
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: 3 additions & 5 deletions lib/DAV/Xml/Property/Complex.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,9 @@ public static function xmlDeserialize(Reader $reader)
$reader->read();

if ($nonText) {
$new = new self($xml);

return $new;
} else {
return $text;
return new self($xml);
}

return $text;
}
}
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
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
4 changes: 2 additions & 2 deletions lib/DAV/Xml/Request/PropPatch.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ 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)) {
if (null === $propertyValue) {
$writer->startElement('{DAV:}remove');
$writer->write(['{DAV:}prop' => [$propertyName => $propertyValue]]);
$writer->endElement();
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
6 changes: 2 additions & 4 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 @@ -37,10 +37,8 @@ class Service extends \Sabre\Xml\Service
*
* If you are defining your own custom namespace, add it here to reduce
* bandwidth and improve legibility of xml bodies.
*
* @var array
*/
public $namespaceMap = [
public array $namespaceMap = [
'DAV:' => 'd',
'http://sabredav.org/ns' => 's',
];
Expand Down
2 changes: 1 addition & 1 deletion lib/DAVACL/Xml/Property/Acl.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion lib/DAVACL/Xml/Property/AclRestrictions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion lib/DAVACL/Xml/Property/CurrentUserPrivilegeSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion lib/DAVACL/Xml/Property/Principal.php
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion lib/DAVACL/Xml/Property/SupportedPrivilegeSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}
Expand Down
Loading

0 comments on commit e77f38b

Please sign in to comment.