diff --git a/src/Resource/Feed/Category.php b/src/Resource/Feed/Category.php index 594413a..6bc2fa1 100644 --- a/src/Resource/Feed/Category.php +++ b/src/Resource/Feed/Category.php @@ -6,11 +6,8 @@ use SimpleXMLElement; final class Category extends News { - private string $categoryName; - - public function __construct(SimpleXMLElement $xml, string $name) { + public function __construct(SimpleXMLElement $xml, private readonly string $categoryName) { parent::__construct($xml); - $this->categoryName = $name; } public function getCategoryName(): string { diff --git a/src/Resource/Feed/Package.php b/src/Resource/Feed/Package.php index 83d2a41..f4a9008 100644 --- a/src/Resource/Feed/Package.php +++ b/src/Resource/Feed/Package.php @@ -6,11 +6,8 @@ use SimpleXMLElement; final class Package extends News { - private string $packageName; - - public function __construct(SimpleXMLElement $xml, string $name) { + public function __construct(SimpleXMLElement $xml, private readonly string $packageName) { parent::__construct($xml); - $this->packageName = $name; } public function getPackageName(): string { diff --git a/src/Resource/Feed/User.php b/src/Resource/Feed/User.php index 6f9fe0e..6cba4d8 100644 --- a/src/Resource/Feed/User.php +++ b/src/Resource/Feed/User.php @@ -6,11 +6,8 @@ use SimpleXMLElement; final class User extends News { - private string $userName; - - public function __construct(SimpleXMLElement $xml, string $name) { + public function __construct(SimpleXMLElement $xml, private readonly string $userName) { parent::__construct($xml); - $this->userName = $name; } public function getUserName(): string {