From 065915397a35a1564c4d498db3753ca0a868c007 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Wed, 14 Apr 2021 10:50:32 +0200 Subject: [PATCH] zend: PHP 8 compatiblity changes `ReflectionClass::newInstanceArgs()` seems to respect string keys since PHP 8. refs #4289 --- library/vendor/Zend/Filter.php | 2 +- library/vendor/Zend/Filter/Input.php | 2 +- library/vendor/Zend/Form/Element.php | 4 ++-- library/vendor/Zend/Server/Abstract.php | 2 +- library/vendor/Zend/Soap/Server/Proxy.php | 2 +- library/vendor/Zend/Validate.php | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/library/vendor/Zend/Filter.php b/library/vendor/Zend/Filter.php index eab782f14..d05bdf8dd 100644 --- a/library/vendor/Zend/Filter.php +++ b/library/vendor/Zend/Filter.php @@ -224,7 +224,7 @@ class Zend_Filter implements Zend_Filter_Interface $class = new ReflectionClass($className); if ($class->implementsInterface('Zend_Filter_Interface')) { if ($class->hasMethod('__construct')) { - $object = $class->newInstanceArgs($args); + $object = $class->newInstanceArgs(array_values($args)); } else { $object = $class->newInstance(); } diff --git a/library/vendor/Zend/Filter/Input.php b/library/vendor/Zend/Filter/Input.php index 3ae48a387..0c245a18c 100644 --- a/library/vendor/Zend/Filter/Input.php +++ b/library/vendor/Zend/Filter/Input.php @@ -1185,7 +1185,7 @@ class Zend_Filter_Input } if ($class->hasMethod('__construct')) { - $object = $class->newInstanceArgs($args); + $object = $class->newInstanceArgs(array_values($args)); } else { $object = $class->newInstance(); } diff --git a/library/vendor/Zend/Form/Element.php b/library/vendor/Zend/Form/Element.php index f71d74038..4faf0d7f6 100644 --- a/library/vendor/Zend/Form/Element.php +++ b/library/vendor/Zend/Form/Element.php @@ -2088,7 +2088,7 @@ class Zend_Form_Element implements Zend_Validate_Interface } else { $r = new ReflectionClass($name); if ($r->hasMethod('__construct')) { - $instance = $r->newInstanceArgs((array) $filter['options']); + $instance = $r->newInstanceArgs(array_values((array) $filter['options'])); } else { $instance = $r->newInstance(); } @@ -2154,7 +2154,7 @@ class Zend_Form_Element implements Zend_Validate_Interface } if ($numeric) { - $instance = $r->newInstanceArgs((array) $validator['options']); + $instance = $r->newInstanceArgs(array_values((array) $validator['options'])); } else { $instance = $r->newInstance($validator['options']); } diff --git a/library/vendor/Zend/Server/Abstract.php b/library/vendor/Zend/Server/Abstract.php index a6278accb..7f3d1eb87 100644 --- a/library/vendor/Zend/Server/Abstract.php +++ b/library/vendor/Zend/Server/Abstract.php @@ -217,7 +217,7 @@ abstract class Zend_Server_Abstract implements Zend_Server_Interface $invokeArgs = $invocable->getInvokeArguments(); if (!empty($invokeArgs)) { $reflection = new ReflectionClass($class); - $object = $reflection->newInstanceArgs($invokeArgs); + $object = $reflection->newInstanceArgs(array_values($invokeArgs)); } else { $object = new $class; } diff --git a/library/vendor/Zend/Soap/Server/Proxy.php b/library/vendor/Zend/Soap/Server/Proxy.php index 93b6ab4e6..addecd1c1 100644 --- a/library/vendor/Zend/Soap/Server/Proxy.php +++ b/library/vendor/Zend/Soap/Server/Proxy.php @@ -42,7 +42,7 @@ class Zend_Soap_Server_Proxy if ($constructor === null) { $this->_classInstance = $class->newInstance(); } else { - $this->_classInstance = $class->newInstanceArgs($classArgs); + $this->_classInstance = $class->newInstanceArgs(array_values($classArgs)); } $this->_className = $className; } diff --git a/library/vendor/Zend/Validate.php b/library/vendor/Zend/Validate.php index c8796e42e..34f72be80 100644 --- a/library/vendor/Zend/Validate.php +++ b/library/vendor/Zend/Validate.php @@ -221,7 +221,7 @@ class Zend_Validate implements Zend_Validate_Interface } if ($numeric) { - $object = $class->newInstanceArgs($args); + $object = $class->newInstanceArgs(array_values($args)); } else { $object = $class->newInstance($args); }