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:
Dylan K. Taylor
2022-04-25 00:06:26 +01:00
parent ded7e24f67
commit c8a7a53d70
58 changed files with 258 additions and 444 deletions

View File

@ -35,15 +35,12 @@ use pocketmine\world\Position;
class EntityTeleportEvent extends EntityEvent implements Cancellable{
use CancellableTrait;
/** @var Position */
private $from;
/** @var Position */
private $to;
public function __construct(Entity $entity, Position $from, Position $to){
public function __construct(
Entity $entity,
private Position $from,
private Position $to
){
$this->entity = $entity;
$this->from = $from;
$this->to = $to;
}
public function getFrom() : Position{