zend: PHP 8 compatiblity changes

`ReflectionClass::newInstanceArgs()` seems to respect string keys
since PHP 8.

refs #4289
This commit is contained in:
Johannes Meyer 2021-04-14 10:50:32 +02:00
parent d9a87f76a2
commit 065915397a
6 changed files with 7 additions and 7 deletions

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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']);
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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);
}