diff --git a/src/Attribute/OnEvent.php b/src/Attribute/OnEvent.php index 6d3d54c..165ec8a 100644 --- a/src/Attribute/OnEvent.php +++ b/src/Attribute/OnEvent.php @@ -12,6 +12,9 @@ public string $event; public int $priority; + /** + * @param class-string $event + */ public function __construct(string $event, int $priority = 0) { $this->event = $event; diff --git a/src/LongPollingService.php b/src/LongPollingService.php index 24bb531..5d691ec 100644 --- a/src/LongPollingService.php +++ b/src/LongPollingService.php @@ -40,7 +40,7 @@ public function setTimeLimit(int $timeLimit): void public function cunsumeUpdates(): \Generator { $start = \hrtime()[0]; - $checkTimeLimit = fn() => $this->timeLimit > 0 && \hrtime()[0] - $start >= $this->timeLimit; + $checkTimeLimit = static fn() => $this->timeLimit > 0 && \hrtime()[0] - $start >= $this->timeLimit; while (true) { foreach ($this->getUpdates() as $update) { diff --git a/src/config/compilerpass.php b/src/config/compilerpass.php index 49bb6cc..f7ac858 100644 --- a/src/config/compilerpass.php +++ b/src/config/compilerpass.php @@ -27,10 +27,10 @@ public function process(ContainerBuilder $container): void } // Commands have the highest priority by default - \usort($controllersMap, fn(array $a, array $b) => \str_starts_with($a['value'], '/') ? -1 : 1); + \usort($controllersMap, static fn(array $a, array $b) => \str_starts_with($a['value'], '/') ? -1 : 1); // Sort by priority - \usort($controllersMap, fn(array $a, array $b) => $b['priority'] <=> $a['priority']); + \usort($controllersMap, static fn(array $a, array $b) => $b['priority'] <=> $a['priority']); foreach ($controllersMap as $id => $row) { unset($controllersMap[$id]['priority']);