zend: PHP 8 compatiblity changes
`ReflectionClass::newInstanceArgs()` seems to respect string keys since PHP 8. refs #4289
This commit is contained in:
parent
d9a87f76a2
commit
065915397a
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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']);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue