Modernize private property declarations in src/entity

This commit is contained in:
Dylan K. Taylor
2022-05-17 20:42:17 +01:00
parent 343a12626e
commit ec6769a6fc
13 changed files with 49 additions and 96 deletions

View File

@ -28,23 +28,12 @@ use pocketmine\utils\Limits;
use function max;
class EffectInstance{
/** @var Effect */
private $effectType;
/** @var int */
private $duration;
/** @var int */
private $amplifier;
/** @var bool */
private $visible;
/** @var bool */
private $ambient;
/** @var Color */
private $color;
private Effect $effectType;
private int $duration;
private int $amplifier;
private bool $visible;
private bool $ambient;
private Color $color;
/**
* @param int|null $duration Passing null will use the effect type's default duration

View File

@ -34,9 +34,6 @@ use function spl_object_id;
class EffectManager{
/** @var Living */
private $entity;
/** @var EffectInstance[] */
protected $effects = [];
@ -56,8 +53,9 @@ class EffectManager{
*/
protected $effectRemoveHooks;
public function __construct(Living $entity){
$this->entity = $entity;
public function __construct(
private Living $entity
){
$this->bubbleColor = new Color(0, 0, 0, 0);
$this->effectAddHooks = new ObjectSet();
$this->effectRemoveHooks = new ObjectSet();

View File

@ -30,9 +30,7 @@ use pocketmine\event\entity\EntityDamageEvent;
use pocketmine\lang\Translatable;
class PoisonEffect extends Effect{
/** @var bool */
private $fatal;
private bool $fatal;
public function __construct(Translatable|string $name, Color $color, bool $isBad = false, int $defaultDuration = 600, bool $hasBubbles = true, bool $fatal = false){
parent::__construct($name, $color, $isBad, $defaultDuration, $hasBubbles);