mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-09 03:06:55 +00:00
event: modernize property declarations where possible
only private fields are modified; protected ones can't be changed in case someone extended the classes
This commit is contained in:
@ -39,15 +39,12 @@ class EntityRegainHealthEvent extends EntityEvent implements Cancellable{
|
||||
public const CAUSE_CUSTOM = 3;
|
||||
public const CAUSE_SATURATION = 4;
|
||||
|
||||
/** @var float */
|
||||
private $amount;
|
||||
/** @var int */
|
||||
private $reason;
|
||||
|
||||
public function __construct(Entity $entity, float $amount, int $regainReason){
|
||||
public function __construct(
|
||||
Entity $entity,
|
||||
private float $amount,
|
||||
private int $regainReason
|
||||
){
|
||||
$this->entity = $entity;
|
||||
$this->amount = $amount;
|
||||
$this->reason = $regainReason;
|
||||
}
|
||||
|
||||
public function getAmount() : float{
|
||||
@ -62,6 +59,6 @@ class EntityRegainHealthEvent extends EntityEvent implements Cancellable{
|
||||
* Returns one of the CAUSE_* constants to indicate why this regeneration occurred.
|
||||
*/
|
||||
public function getRegainReason() : int{
|
||||
return $this->reason;
|
||||
return $this->regainReason;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user