From 8e58beef7f210df12e0acbd6b274655ff6b35fa1 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Fri, 3 Sep 2021 20:32:13 +0100 Subject: [PATCH] Effect: use promoted properties --- src/entity/effect/Effect.php | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/src/entity/effect/Effect.php b/src/entity/effect/Effect.php index 277b16972..c6d1c6e43 100644 --- a/src/entity/effect/Effect.php +++ b/src/entity/effect/Effect.php @@ -29,31 +29,20 @@ use pocketmine\entity\Living; class Effect{ - /** @var int */ - protected $internalRuntimeId; - /** @var string */ - protected $name; - /** @var Color */ - protected $color; - /** @var bool */ - protected $bad; - /** @var bool */ - protected $hasBubbles; - /** * @param int $internalRuntimeId Internal runtime ID, unique to this effect type. Used for comparisons. * @param string $name Translation key used for effect name * @param Color $color Color of bubbles given by this effect - * @param bool $isBad Whether the effect is harmful + * @param bool $bad Whether the effect is harmful * @param bool $hasBubbles Whether the effect has potion bubbles. Some do not (e.g. Instant Damage has its own particles instead of bubbles) */ - public function __construct(int $internalRuntimeId, string $name, Color $color, bool $isBad = false, bool $hasBubbles = true){ - $this->internalRuntimeId = $internalRuntimeId; - $this->name = $name; - $this->color = $color; - $this->bad = $isBad; - $this->hasBubbles = $hasBubbles; - } + public function __construct( + protected int $internalRuntimeId, + protected string $name, + protected Color $color, + protected bool $bad = false, + protected bool $hasBubbles = true + ){} /** * Returns a unique identifier for this effect type