Move property initializations from constructor to property

This is doing the same as before, in pretty much the same execution
order. The only difference is the syntax.

In JavaScript it's relevant to not do array initializations to early.
Otherwise different instances share the same array. But this doesn't
happen in PHP.

Change-Id: I56363ccadf29f2b806f765ab8f54a3c1863fc10f
This commit is contained in:
thiemowmde 2023-12-15 17:16:46 +01:00 committed by jenkins-bot
parent eeb8e28e52
commit 8094a0ebf5

View file

@ -23,20 +23,18 @@ class RefGroup {
/**
* @var stdClass[]
*/
public $refs;
public array $refs = [];
/**
* @var stdClass[]
*/
public $indexByName;
public array $indexByName = [];
/**
* @param string $group
*/
public function __construct( string $group = '' ) {
$this->name = $group;
$this->refs = [];
$this->indexByName = [];
}
/**