From 400ad694972134521e9eebffbc5cfe1fe173701b Mon Sep 17 00:00:00 2001 From: Bastian Lederer Date: Thu, 4 Dec 2025 15:08:59 +0100 Subject: [PATCH] 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. --- application/forms/BpConfigForm.php | 2 +- application/forms/SimulationForm.php | 2 +- library/Businessprocess/BpConfig.php | 2 +- library/Businessprocess/Web/Form/QuickBaseForm.php | 2 +- library/Businessprocess/Web/Form/QuickForm.php | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/application/forms/BpConfigForm.php b/application/forms/BpConfigForm.php index 0e9a5b3..a11d59b 100644 --- a/application/forms/BpConfigForm.php +++ b/application/forms/BpConfigForm.php @@ -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() )); } diff --git a/application/forms/SimulationForm.php b/application/forms/SimulationForm.php index cabd859..88a08fc 100644 --- a/application/forms/SimulationForm.php +++ b/application/forms/SimulationForm.php @@ -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()) ) diff --git a/library/Businessprocess/BpConfig.php b/library/Businessprocess/BpConfig.php index f0b3584..2aae1aa 100644 --- a/library/Businessprocess/BpConfig.php +++ b/library/Businessprocess/BpConfig.php @@ -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) { diff --git a/library/Businessprocess/Web/Form/QuickBaseForm.php b/library/Businessprocess/Web/Form/QuickBaseForm.php index b5d8961..0e889f7 100644 --- a/library/Businessprocess/Web/Form/QuickBaseForm.php +++ b/library/Businessprocess/Web/Form/QuickBaseForm.php @@ -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) diff --git a/library/Businessprocess/Web/Form/QuickForm.php b/library/Businessprocess/Web/Form/QuickForm.php index 2420678..96a84cd 100644 --- a/library/Businessprocess/Web/Form/QuickForm.php +++ b/library/Businessprocess/Web/Form/QuickForm.php @@ -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(