Skip to content

Commit

Permalink
Merge pull request #607 from phil-davis/support-sabre-xml-v4-4.5-series
Browse files Browse the repository at this point in the history
Support sabre/xml v4
  • Loading branch information
phil-davis authored Jan 22, 2023
2 parents 1f83674 + bad63c0 commit fe6d918
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 10 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
ChangeLog
=========

4.5.3 (2023-01-22)
------------------

* #607: Apply 'Support sabre/xml v4' and needed code changes to 4.5 branch (@phil-davis)

4.5.2 (2023-01-20)
------------------

* #603: Support sabre/xml v4 (@gharlan)

4.5.1 (2022-10-09)
------------------

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"require" : {
"php" : "^7.1 || ^8.0",
"ext-mbstring" : "*",
"sabre/xml" : "^2.1"
"sabre/xml" : "^2.1 || ^3.0 || ^4.0"
},
"require-dev" : {
"friendsofphp/php-cs-fixer": "~2.17.1",
Expand Down
2 changes: 1 addition & 1 deletion lib/Component.php
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ public function jsonSerialize()
*
* @param Xml\Writer $writer XML writer
*/
public function xmlSerialize(Xml\Writer $writer)
public function xmlSerialize(Xml\Writer $writer): void
{
$components = [];
$properties = [];
Expand Down
2 changes: 1 addition & 1 deletion lib/Component/VCard.php
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ public function jsonSerialize()
*
* @param Xml\Writer $writer XML writer
*/
public function xmlSerialize(Xml\Writer $writer)
public function xmlSerialize(Xml\Writer $writer): void
{
$propertiesByGroup = [];

Expand Down
2 changes: 1 addition & 1 deletion lib/Node.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ abstract public function jsonSerialize();
*
* @param Xml\Writer $writer XML writer
*/
abstract public function xmlSerialize(Xml\Writer $writer);
abstract public function xmlSerialize(Xml\Writer $writer): void;

/**
* Call this method on a document if you're done using it.
Expand Down
2 changes: 1 addition & 1 deletion lib/Parameter.php
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ public function jsonSerialize()
*
* @param Xml\Writer $writer XML writer
*/
public function xmlSerialize(Xml\Writer $writer)
public function xmlSerialize(Xml\Writer $writer): void
{
foreach (explode(',', $this->value) as $value) {
$writer->writeElement('text', $value);
Expand Down
4 changes: 1 addition & 3 deletions lib/Parser/XML/Element/KeyValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,8 @@ class KeyValue extends SabreXml\Element\KeyValue
* the next element.
*
* @param XML\Reader $reader
*
* @return mixed
*/
public static function xmlDeserialize(SabreXml\Reader $reader)
public static function xmlDeserialize(SabreXml\Reader $reader): array
{
// If there's no children, we don't do anything.
if ($reader->isEmptyElement) {
Expand Down
2 changes: 1 addition & 1 deletion lib/Property.php
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ public function setXmlValue(array $value)
*
* @param Xml\Writer $writer XML writer
*/
public function xmlSerialize(Xml\Writer $writer)
public function xmlSerialize(Xml\Writer $writer): void
{
$parameters = [];

Expand Down
2 changes: 1 addition & 1 deletion lib/Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ class Version
/**
* Full version number.
*/
const VERSION = '4.5.1';
public const VERSION = '4.5.3';
}
11 changes: 11 additions & 0 deletions tests/VObject/TimeZoneUtilTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,17 @@ public function testTimeZoneIdentifiers($tzid)
*/
public function testTimeZoneBCIdentifiers($tzid)
{
/*
* A regression was introduced in PHP 8.1.14 and 8.2.1
* Timezone ids containing a "+" like "GMT+10" do not work.
* See https://github.com/php/php-src/issues/10218
* The regression should be fixed in the next patch releases of PHP
* that should be released in Feb 2023.
*/
$versionOfPHP = \phpversion();
if ((('8.1.14' == $versionOfPHP) || ('8.2.1' == $versionOfPHP)) && \str_contains($tzid, '+')) {
$this->markTestSkipped("Timezone ids containing '+' do not work on PHP $versionOfPHP");
}
$tz = TimeZoneUtil::getTimeZone($tzid);
$ex = new \DateTimeZone($tzid);

Expand Down

0 comments on commit fe6d918

Please sign in to comment.