Fix phpstan

This commit is contained in:
crazywhalecc 2025-03-17 14:31:51 +08:00
parent a39e96acd2
commit 1183766701
No known key found for this signature in database
GPG Key ID: 1F4BDD59391F2680

View File

@ -25,7 +25,7 @@ trait CommandInteractTrait
* @param string $message * @param string $message
* @param mixed[] $context * @param mixed[] $context
*/ */
public function emergency($message, array $context = []) public function emergency($message, array $context = []): void
{ {
$this->log(LogLevel::EMERGENCY, $message, $context); $this->log(LogLevel::EMERGENCY, $message, $context);
} }
@ -39,7 +39,7 @@ trait CommandInteractTrait
* @param string $message * @param string $message
* @param mixed[] $context * @param mixed[] $context
*/ */
public function alert($message, array $context = []) public function alert($message, array $context = []): void
{ {
$this->log(LogLevel::ALERT, $message, $context); $this->log(LogLevel::ALERT, $message, $context);
} }
@ -52,7 +52,7 @@ trait CommandInteractTrait
* @param string $message * @param string $message
* @param mixed[] $context * @param mixed[] $context
*/ */
public function critical($message, array $context = []) public function critical($message, array $context = []): void
{ {
$this->log(LogLevel::CRITICAL, $message, $context); $this->log(LogLevel::CRITICAL, $message, $context);
} }
@ -64,7 +64,7 @@ trait CommandInteractTrait
* @param string $message * @param string $message
* @param mixed[] $context * @param mixed[] $context
*/ */
public function error($message, array $context = []) public function error($message, array $context = []): void
{ {
$this->log(LogLevel::ERROR, $message, $context); $this->log(LogLevel::ERROR, $message, $context);
} }
@ -78,7 +78,7 @@ trait CommandInteractTrait
* @param string $message * @param string $message
* @param mixed[] $context * @param mixed[] $context
*/ */
public function warning($message, array $context = []) public function warning($message, array $context = []): void
{ {
$this->log(LogLevel::WARNING, $message, $context); $this->log(LogLevel::WARNING, $message, $context);
} }
@ -89,7 +89,7 @@ trait CommandInteractTrait
* @param string $message * @param string $message
* @param mixed[] $context * @param mixed[] $context
*/ */
public function notice($message, array $context = []) public function notice($message, array $context = []): void
{ {
$this->log(LogLevel::NOTICE, $message, $context); $this->log(LogLevel::NOTICE, $message, $context);
} }
@ -101,7 +101,7 @@ trait CommandInteractTrait
* *
* @param string $message * @param string $message
*/ */
public function info($message, array $context = []) public function info($message, array $context = []): void
{ {
$this->log(LogLevel::INFO, $message, $context); $this->log(LogLevel::INFO, $message, $context);
} }
@ -111,12 +111,12 @@ trait CommandInteractTrait
* *
* @param string $message * @param string $message
*/ */
public function debug($message, array $context = []) public function debug($message, array $context = []): void
{ {
$this->log(LogLevel::DEBUG, $message, $context); $this->log(LogLevel::DEBUG, $message, $context);
} }
public function log($level, $message, array $context = []) public function log($level, $message, array $context = []): void
{ {
$msg = match ($level) { $msg = match ($level) {
'info' => "<info>{$message}</info>", 'info' => "<info>{$message}</info>",