Skip to content

Commit

Permalink
chore: initialize on declaration intead of in the constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
jsconan committed Apr 17, 2024
1 parent 9ba9ebd commit 62e0e93
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions models/classes/TestCategoryPreset.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class TestCategoryPreset implements JsonSerializable
/**
* @var string[] $altCategories - the other possible qti categories that would activate the preset
*/
private $altCategories;
private $altCategories = [];

/**
* @var string $description - what is the category purpose
Expand Down Expand Up @@ -97,8 +97,6 @@ public function __construct($id, $label, $qtiCategory, $data)
$this->label = (string) $label;
$this->qtiCategory = (string) $qtiCategory;

$this->altCategories = [];

if (isset($data['description'])) {
$this->description = (string) $data['description'];
}
Expand Down Expand Up @@ -136,7 +134,7 @@ public function getAltCategory(): array
return $this->altCategories;
}

public function getDescription(): ?string
public function getDescription(): string
{
return $this->description;
}
Expand Down

0 comments on commit 62e0e93

Please sign in to comment.