diff --git a/src/muqsit/tebex/handler/command/utils/ClosureCommandExecutor.php b/src/muqsit/tebex/handler/command/utils/ClosureCommandExecutor.php index 4bb30be..813109e 100644 --- a/src/muqsit/tebex/handler/command/utils/ClosureCommandExecutor.php +++ b/src/muqsit/tebex/handler/command/utils/ClosureCommandExecutor.php @@ -12,9 +12,7 @@ final class ClosureCommandExecutor implements CommandExecutor{ /** - * @param Closure $executor - * - * @phpstan-param Closure(CommandSender, Command, string, string[]) : bool $executor + * @param Closure(CommandSender, Command, string, string[]) : bool $executor */ public function __construct( private Closure $executor diff --git a/src/muqsit/tebex/handler/due/TebexDueCommandsHandler.php b/src/muqsit/tebex/handler/due/TebexDueCommandsHandler.php index 6d5e859..70ee984 100644 --- a/src/muqsit/tebex/handler/due/TebexDueCommandsHandler.php +++ b/src/muqsit/tebex/handler/due/TebexDueCommandsHandler.php @@ -26,10 +26,8 @@ final class TebexDueCommandsHandler{ /** * @param string $game_type - * @param Closure $on_match + * @param Closure(Player, TebexDuePlayerHolder) : void $on_match * @return TebexDuePlayerList - * - * @phpstan-param Closure(Player, TebexDuePlayerHolder) : void $on_match */ private static function getListFromGameType(string $game_type, Closure $on_match) : TebexDuePlayerList{ return new TebexDuePlayerList(match($game_type){ @@ -92,9 +90,7 @@ public function __construct( } /** - * @param Closure|null $callback - * - * @phpstan-param Closure(int) : void $callback + * @param (Closure(int) : void)|null $callback */ public function markAllAsExecuted(?Closure $callback = null) : void{ $this->plugin->getApi()->getDuePlayersList(TebexResponseHandler::onSuccess(function(TebexDuePlayersInfo $result) use($callback) : void{ @@ -147,9 +143,7 @@ public function getList() : TebexDuePlayerList{ } /** - * @param Closure|null $callback - * - * @phpstan-param Closure(int, int) : void $callback + * @param (Closure(int, int) : void)|null $callback */ public function refresh(?Closure $callback = null) : void{ $this->offline_commands_handler->check(function(int $offline_cmds_count) use($callback) : void{ @@ -162,11 +156,8 @@ public function refresh(?Closure $callback = null) : void{ } /** - * @param Closure|null $reschedule_condition - * @param Closure|null $callback - * - * @phpstan-param Closure() : bool $reschedule_condition - * @phpstan-param Closure(int) : void $callback + * @param (Closure() : bool)|null $reschedule_condition + * @param (Closure(int) : void)|null $callback */ public function checkDuePlayers(?Closure $reschedule_condition = null, ?Closure $callback = null) : void{ $this->plugin->getApi()->getDuePlayersList(TebexResponseHandler::onSuccess(function(TebexDuePlayersInfo $result) use($reschedule_condition, $callback) : void{ diff --git a/src/muqsit/tebex/handler/due/TebexDueOfflineCommandsHandler.php b/src/muqsit/tebex/handler/due/TebexDueOfflineCommandsHandler.php index 0679c2f..7a08bce 100644 --- a/src/muqsit/tebex/handler/due/TebexDueOfflineCommandsHandler.php +++ b/src/muqsit/tebex/handler/due/TebexDueOfflineCommandsHandler.php @@ -33,9 +33,7 @@ public function __construct(Loader $plugin, TebexHandler $handler, int $check_pe } /** - * @param Closure|null $callback - * - * @phpstan-param Closure(int) : void $callback + * @param (Closure(int) : void)|null $callback */ public function check(?Closure $callback = null) : void{ $this->plugin->getApi()->getQueuedOfflineCommands(TebexResponseHandler::onSuccess(function(TebexQueuedOfflineCommandsInfo $info) use($callback) : void{ @@ -47,9 +45,7 @@ public function check(?Closure $callback = null) : void{ } /** - * @param Closure|null $callback - * - * @phpstan-param Closure(int) : void $callback + * @param (Closure(int) : void)|null $callback */ public function markAllAsExecuted(?Closure $callback = null) : void{ $this->plugin->getApi()->getQueuedOfflineCommands(TebexResponseHandler::onSuccess(function(TebexQueuedOfflineCommandsInfo $info) use($callback) : void{ @@ -85,9 +81,7 @@ private function onFetchDueOfflineCommands(TebexQueuedOfflineCommandsInfo $info) /** * @param TebexQueuedOfflineCommand $command - * @param Closure $callback - * - * @phpstan-param Closure(bool) : void $callback + * @param Closure(bool) : void $callback */ private function executeCommand(TebexQueuedOfflineCommand $command, Closure $callback) : void{ $delay = $command->getConditions()->getDelay(); diff --git a/src/muqsit/tebex/handler/due/playerlist/TebexDuePlayerList.php b/src/muqsit/tebex/handler/due/playerlist/TebexDuePlayerList.php index 314081a..f891f17 100644 --- a/src/muqsit/tebex/handler/due/playerlist/TebexDuePlayerList.php +++ b/src/muqsit/tebex/handler/due/playerlist/TebexDuePlayerList.php @@ -12,32 +12,18 @@ final class TebexDuePlayerList{ - /** - * @var TebexDuePlayerHolder[] - * - * @phpstan-var array - */ + /** @var array */ private array $tebex_due_players_by_id = []; // indexes pending customers by TebexPlayerId => TebexDuePlayerHolder - /** - * @var int[] - * - * @phpstan-var array - */ + /** @var array */ private array $tebex_due_players_by_index = []; // indexes pending customers by TebexDuePlayerList::$indexer => TebexPlayerId - /** - * @var TebexPlayerSession[] - * - * @phpstan-var array - */ + /** @var array */ private array $online_players = []; // indexes online players on the server by TebexDuePlayerList::$indexer => TebexPlayerSession /** - * @param Closure $on_match + * @param Closure(Player, TebexDuePlayerHolder) : void $on_match * @param PlayerIndexer $indexer - * - * @phpstan-param Closure(Player, TebexDuePlayerHolder) : void $on_match */ public function __construct( private PlayerIndexer $indexer, diff --git a/src/muqsit/tebex/handler/due/session/TebexPlayerSession.php b/src/muqsit/tebex/handler/due/session/TebexPlayerSession.php index fc79a57..84e9e66 100644 --- a/src/muqsit/tebex/handler/due/session/TebexPlayerSession.php +++ b/src/muqsit/tebex/handler/due/session/TebexPlayerSession.php @@ -43,9 +43,7 @@ public function destroy() : void{ /** * @param TebexQueuedOnlineCommand $command * @param TebexDuePlayer $due_player - * @param Closure $callback - * - * @phpstan-param Closure(bool) : void $callback + * @param Closure(bool) : void $callback */ public function executeOnlineCommand(TebexQueuedOnlineCommand $command, TebexDuePlayer $due_player, Closure $callback) : void{ $conditions = $command->getConditions(); @@ -61,10 +59,8 @@ public function executeOnlineCommand(TebexQueuedOnlineCommand $command, TebexDue * @param TebexQueuedOnlineCommand $command * @param TebexDuePlayer $due_player * @param int $delay - * @param Closure $callback + * @param Closure(bool) : void $callback * @return bool - * - * @phpstan-param Closure(bool) : void $callback */ private function scheduleCommandForDelay(TebexQueuedOnlineCommand $command, TebexDuePlayer $due_player, int $delay, Closure $callback) : bool{ if(isset($this->delayed_online_command_handlers[$id = $command->getId()])){ diff --git a/src/muqsit/tebex/thread/TebexThread.php b/src/muqsit/tebex/thread/TebexThread.php index 0830e8d..b19d605 100644 --- a/src/muqsit/tebex/thread/TebexThread.php +++ b/src/muqsit/tebex/thread/TebexThread.php @@ -22,11 +22,7 @@ final class TebexThread extends Thread{ - /** - * @var TebexResponseHandler[] - * - * @phpstan-var TebexResponseHandler[] - */ + /** @var TebexResponseHandler[] */ private static array $handlers = []; private static int $handler_ids = 0; @@ -66,12 +62,9 @@ public function __construct(Logger $logger, SleeperNotifier $notifier, string $s } /** - * @param TebexRequest $request - * @param TebexResponseHandler $handler - * - * @phpstan-template TTebexResponse of \muqsit\tebexapi\connection\response\TebexResponse - * @phpstan-param TebexRequest $request - * @phpstan-param TebexResponseHandler $handler + * @template TTebexResponse of TebexResponse + * @param TebexRequest $request + * @param TebexResponseHandler $handler */ public function push(TebexRequest $request, TebexResponseHandler $handler) : void{ $handler_id = ++self::$handler_ids;