mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-05 17:36:12 +00:00
Modernize private property declarations in src/network
This commit is contained in:
@ -51,32 +51,16 @@ use function is_array;
|
||||
* Handles the initial login phase of the session. This handler is used as the initial state.
|
||||
*/
|
||||
class LoginPacketHandler extends PacketHandler{
|
||||
|
||||
/** @var Server */
|
||||
private $server;
|
||||
/** @var NetworkSession */
|
||||
private $session;
|
||||
/**
|
||||
* @var \Closure
|
||||
* @phpstan-var \Closure(PlayerInfo) : void
|
||||
*/
|
||||
private $playerInfoConsumer;
|
||||
/**
|
||||
* @var \Closure
|
||||
* @phpstan-var \Closure(bool, bool, ?string, ?string) : void
|
||||
*/
|
||||
private $authCallback;
|
||||
|
||||
/**
|
||||
* @phpstan-param \Closure(PlayerInfo) : void $playerInfoConsumer
|
||||
* @phpstan-param \Closure(bool $isAuthenticated, bool $authRequired, ?string $error, ?string $clientPubKey) : void $authCallback
|
||||
*/
|
||||
public function __construct(Server $server, NetworkSession $session, \Closure $playerInfoConsumer, \Closure $authCallback){
|
||||
$this->session = $session;
|
||||
$this->server = $server;
|
||||
$this->playerInfoConsumer = $playerInfoConsumer;
|
||||
$this->authCallback = $authCallback;
|
||||
}
|
||||
public function __construct(
|
||||
private Server $server,
|
||||
private NetworkSession $session,
|
||||
private \Closure $playerInfoConsumer,
|
||||
private \Closure $authCallback
|
||||
){}
|
||||
|
||||
public function handleLogin(LoginPacket $packet) : bool{
|
||||
if(!$this->isCompatibleProtocol($packet->protocol)){
|
||||
|
Reference in New Issue
Block a user