mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 04:17:07 +00:00
Network: Improve typeinfo for PHPStan on bannedIps
This commit is contained in:
parent
95ad3f16e1
commit
cd016bedce
@ -28,6 +28,7 @@ namespace pocketmine\network;
|
||||
|
||||
use pocketmine\event\server\NetworkInterfaceRegisterEvent;
|
||||
use pocketmine\event\server\NetworkInterfaceUnregisterEvent;
|
||||
use pocketmine\utils\Utils;
|
||||
use function base64_encode;
|
||||
use function get_class;
|
||||
use function preg_match;
|
||||
@ -45,7 +46,10 @@ class Network{
|
||||
/** @var RawPacketHandler[] */
|
||||
private $rawPacketHandlers = [];
|
||||
|
||||
/** @var int[] */
|
||||
/**
|
||||
* @var int[]
|
||||
* @phpstan-var array<string, int>
|
||||
*/
|
||||
private $bannedIps = [];
|
||||
|
||||
/** @var BidirectionalBandwidthStatsTracker */
|
||||
@ -103,7 +107,7 @@ class Network{
|
||||
if($interface instanceof AdvancedNetworkInterface){
|
||||
$this->advancedInterfaces[$hash] = $interface;
|
||||
$interface->setNetwork($this);
|
||||
foreach($this->bannedIps as $ip => $until){
|
||||
foreach(Utils::stringifyKeys($this->bannedIps) as $ip => $until){
|
||||
$interface->blockAddress($ip);
|
||||
}
|
||||
foreach($this->rawPacketHandlers as $handler){
|
||||
|
Loading…
x
Reference in New Issue
Block a user