mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2026-02-02 08:29:26 -05:00
Set BpConifg::name by a constructor argument with default
A bug was caused by BpConfig::getName returning null, because the result was used as an array key, which is deprecated since PHP-8.5. To avoid any further issues the constructor now ensures the name is always set.
This commit is contained in:
parent
5bba8ba0ec
commit
b153a51cb6
1 changed files with 3 additions and 2 deletions
|
|
@ -133,8 +133,9 @@ class BpConfig
|
|||
/** @var bool Whether the config is faulty */
|
||||
protected $isFaulty = false;
|
||||
|
||||
public function __construct()
|
||||
public function __construct(string $name = 'dummy')
|
||||
{
|
||||
$this->setName($name);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -605,7 +606,7 @@ class BpConfig
|
|||
public function listInvolvedConfigs(&$configs = null)
|
||||
{
|
||||
if ($configs === null) {
|
||||
$configs[$this->getName() ?? ''] = $this;
|
||||
$configs[$this->getName()] = $this;
|
||||
}
|
||||
|
||||
foreach ($this->importedNodes as $node) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue