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:
Bastian Lederer 2026-01-09 08:35:49 +01:00
parent 5bba8ba0ec
commit b153a51cb6

View file

@ -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) {