1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
|
From: William Desportes <williamdes@wdes.fr>
Date: Sun, 13 Apr 2025 16:07:31 +0200
Subject: Fix PHP 8.4 deprecations
Origin: vendor
Forwarded: no
---
src/Phing/Parser/ExpatParser.php | 1 -
src/Phing/Task/System/Condition/ConditionEnumeration.php | 5 +++++
src/Phing/Task/System/VersionTask.php | 2 +-
src/Phing/Type/Selector/SelectorAware.php | 1 +
4 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/Phing/Parser/ExpatParser.php b/src/Phing/Parser/ExpatParser.php
index 032a3d1..f38bc1f 100644
--- a/src/Phing/Parser/ExpatParser.php
+++ b/src/Phing/Parser/ExpatParser.php
@@ -82,7 +82,6 @@ class ExpatParser extends AbstractSAXParser
}
$this->parser = xml_parser_create();
$this->location = new Location();
- xml_set_object($this->parser, $this);
xml_set_element_handler($this->parser, [$this, 'startElement'], [$this, 'endElement']);
xml_set_character_data_handler($this->parser, [$this, 'characters']);
}
diff --git a/src/Phing/Task/System/Condition/ConditionEnumeration.php b/src/Phing/Task/System/Condition/ConditionEnumeration.php
index 2d8f212..23ae0e9 100644
--- a/src/Phing/Task/System/Condition/ConditionEnumeration.php
+++ b/src/Phing/Task/System/Condition/ConditionEnumeration.php
@@ -47,11 +47,13 @@ class ConditionEnumeration implements Iterator
/**
* @return bool
*/
+ #[\ReturnTypeWillChange]
public function valid()
{
return $this->outer->countConditions() > $this->num;
}
+ #[\ReturnTypeWillChange]
public function current()
{
$o = $this->outer->conditions[$this->num];
@@ -62,6 +64,7 @@ class ConditionEnumeration implements Iterator
return $o;
}
+ #[\ReturnTypeWillChange]
public function next()
{
++$this->num;
@@ -70,11 +73,13 @@ class ConditionEnumeration implements Iterator
/**
* @return int
*/
+ #[\ReturnTypeWillChange]
public function key()
{
return $this->num;
}
+ #[\ReturnTypeWillChange]
public function rewind()
{
$this->num = 0;
diff --git a/src/Phing/Task/System/VersionTask.php b/src/Phing/Task/System/VersionTask.php
index 37119f3..94ad1e4 100644
--- a/src/Phing/Task/System/VersionTask.php
+++ b/src/Phing/Task/System/VersionTask.php
@@ -201,7 +201,7 @@ class VersionTask extends Task
*/
private function getVersion($oldVersion): string
{
- preg_match('#^(?<PREFIX>v)?(?<MAJOR>\d+)?(?:\.(?<MINOR>\d+))?(?:\.(?<BUGFIX>\d+))?#', $oldVersion, $version);
+ preg_match('#^(?<PREFIX>v)?(?<MAJOR>\d+)?(?:\.(?<MINOR>\d+))?(?:\.(?<BUGFIX>\d+))?#', $oldVersion ?? '', $version);
// Setting values if not captured
$version['PREFIX'] = $version['PREFIX'] ?? '';
diff --git a/src/Phing/Type/Selector/SelectorAware.php b/src/Phing/Type/Selector/SelectorAware.php
index 86fb54c..5fa25ce 100644
--- a/src/Phing/Type/Selector/SelectorAware.php
+++ b/src/Phing/Type/Selector/SelectorAware.php
@@ -39,6 +39,7 @@ trait SelectorAware
/**
* Gives the count of the number of selectors in this container.
*/
+ #[\ReturnTypeWillChange]
public function count()
{
return count($this->selectorsList);
|