Replace null as array key with an empty string

Using null as an array key is deprecated in PHP-8.5,
an empty string can be used for identical behavior.
This includes values that are passed to ZendForm::addDisplayGroup as elements,
as they will be used as array keys.
This commit is contained in:
Bastian Lederer 2025-12-04 15:08:59 +01:00
parent 0e11994349
commit 400ad69497
5 changed files with 6 additions and 6 deletions

View file

@ -66,7 +66,7 @@ class BpConfigForm extends BpConfigBaseForm
. ' this process should be retrieved from'
),
'multiOptions' => array(
null => $this->translate('Use the configured default backend'),
'' => $this->translate('Use the configured default backend'),
) + $this->listAvailableBackends()
));
}

View file

@ -127,7 +127,7 @@ class SimulationForm extends BpConfigBaseForm
protected function enumStateNames()
{
$states = array(
null => sprintf(
'' => sprintf(
$this->translate('Use current state (%s)'),
$this->translate($this->node->getStateName())
)

View file

@ -605,7 +605,7 @@ class BpConfig
public function listInvolvedConfigs(&$configs = null)
{
if ($configs === null) {
$configs[$this->getName()] = $this;
$configs[$this->getName() ?? ''] = $this;
}
foreach ($this->importedNodes as $node) {

View file

@ -116,7 +116,7 @@ abstract class QuickBaseForm extends Zend_Form implements ValidHtml
$nullLabel = $this->translate('- please choose -');
}
return array(null => $nullLabel) + $enum;
return array('' => $nullLabel) + $enum;
}
protected function handleOptions($options = null)

View file

@ -131,8 +131,8 @@ abstract class QuickForm extends QuickBaseForm
);
$grp = array(
$this->submitButtonName,
$this->deleteButtonName
$this->submitButtonName ?? '',
$this->deleteButtonName ?? ''
);
$this->addDisplayGroup($grp, 'buttons', array(
'decorators' => array(