Skip to content

Commit fe6d918

Browse files
authored
Merge pull request #607 from phil-davis/support-sabre-xml-v4-4.5-series
Support sabre/xml v4
2 parents 1f83674 + bad63c0 commit fe6d918

File tree

10 files changed

+29
-10
lines changed

10 files changed

+29
-10
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
ChangeLog
22
=========
33

4+
4.5.3 (2023-01-22)
5+
------------------
6+
7+
* #607: Apply 'Support sabre/xml v4' and needed code changes to 4.5 branch (@phil-davis)
8+
9+
4.5.2 (2023-01-20)
10+
------------------
11+
12+
* #603: Support sabre/xml v4 (@gharlan)
13+
414
4.5.1 (2022-10-09)
515
------------------
616

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"require" : {
3535
"php" : "^7.1 || ^8.0",
3636
"ext-mbstring" : "*",
37-
"sabre/xml" : "^2.1"
37+
"sabre/xml" : "^2.1 || ^3.0 || ^4.0"
3838
},
3939
"require-dev" : {
4040
"friendsofphp/php-cs-fixer": "~2.17.1",

lib/Component.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ public function jsonSerialize()
368368
*
369369
* @param Xml\Writer $writer XML writer
370370
*/
371-
public function xmlSerialize(Xml\Writer $writer)
371+
public function xmlSerialize(Xml\Writer $writer): void
372372
{
373373
$components = [];
374374
$properties = [];

lib/Component/VCard.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ public function jsonSerialize()
473473
*
474474
* @param Xml\Writer $writer XML writer
475475
*/
476-
public function xmlSerialize(Xml\Writer $writer)
476+
public function xmlSerialize(Xml\Writer $writer): void
477477
{
478478
$propertiesByGroup = [];
479479

lib/Node.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ abstract public function jsonSerialize();
8282
*
8383
* @param Xml\Writer $writer XML writer
8484
*/
85-
abstract public function xmlSerialize(Xml\Writer $writer);
85+
abstract public function xmlSerialize(Xml\Writer $writer): void;
8686

8787
/**
8888
* Call this method on a document if you're done using it.

lib/Parameter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ public function jsonSerialize()
334334
*
335335
* @param Xml\Writer $writer XML writer
336336
*/
337-
public function xmlSerialize(Xml\Writer $writer)
337+
public function xmlSerialize(Xml\Writer $writer): void
338338
{
339339
foreach (explode(',', $this->value) as $value) {
340340
$writer->writeElement('text', $value);

lib/Parser/XML/Element/KeyValue.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,8 @@ class KeyValue extends SabreXml\Element\KeyValue
3434
* the next element.
3535
*
3636
* @param XML\Reader $reader
37-
*
38-
* @return mixed
3937
*/
40-
public static function xmlDeserialize(SabreXml\Reader $reader)
38+
public static function xmlDeserialize(SabreXml\Reader $reader): array
4139
{
4240
// If there's no children, we don't do anything.
4341
if ($reader->isEmptyElement) {

lib/Property.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ public function setXmlValue(array $value)
318318
*
319319
* @param Xml\Writer $writer XML writer
320320
*/
321-
public function xmlSerialize(Xml\Writer $writer)
321+
public function xmlSerialize(Xml\Writer $writer): void
322322
{
323323
$parameters = [];
324324

lib/Version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ class Version
1414
/**
1515
* Full version number.
1616
*/
17-
const VERSION = '4.5.1';
17+
public const VERSION = '4.5.3';
1818
}

tests/VObject/TimeZoneUtilTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,17 @@ public function testTimeZoneIdentifiers($tzid)
181181
*/
182182
public function testTimeZoneBCIdentifiers($tzid)
183183
{
184+
/*
185+
* A regression was introduced in PHP 8.1.14 and 8.2.1
186+
* Timezone ids containing a "+" like "GMT+10" do not work.
187+
* See https://github.com/php/php-src/issues/10218
188+
* The regression should be fixed in the next patch releases of PHP
189+
* that should be released in Feb 2023.
190+
*/
191+
$versionOfPHP = \phpversion();
192+
if ((('8.1.14' == $versionOfPHP) || ('8.2.1' == $versionOfPHP)) && \str_contains($tzid, '+')) {
193+
$this->markTestSkipped("Timezone ids containing '+' do not work on PHP $versionOfPHP");
194+
}
184195
$tz = TimeZoneUtil::getTimeZone($tzid);
185196
$ex = new \DateTimeZone($tzid);
186197

0 commit comments

Comments
 (0)