diff --git a/composer.json b/composer.json index 17adf3e6..a7e76164 100644 --- a/composer.json +++ b/composer.json @@ -80,6 +80,8 @@ "scripts": { "cs:check": "vendor/bin/php-cs-fixer check", "cs:fix": "vendor/bin/php-cs-fixer fix", + "rector:check": "vendor/bin/rector process --dry-run", + "rector:fix": "vendor/bin/rector process", "phpstan": "vendor/bin/phpstan analyse --memory-limit=-1 --error-format=github", "test": "vendor/bin/phpunit --stderr --testdox --coverage-clover coverage.xml" }, diff --git a/src/App/Helpers/misc.php b/src/App/Helpers/misc.php index f4a333bc..7a90f487 100644 --- a/src/App/Helpers/misc.php +++ b/src/App/Helpers/misc.php @@ -22,8 +22,8 @@ function _message(string $subject, $params): string { if (is_array($params)) { - return preg_replace_callback('/{%\d+}/', function () use (&$params) { - return array_shift($params); + return preg_replace_callback('/{%\d+}/', function (array $matches) use (&$params): string { + return array_shift($params) ?? ''; }, $subject) ?? $subject; } else { return preg_replace('/{%\d+}/', $params, $subject) ?? $subject; diff --git a/src/Environment/Server.php b/src/Environment/Server.php index 8c270b4d..9cbc50b7 100644 --- a/src/Environment/Server.php +++ b/src/Environment/Server.php @@ -69,7 +69,7 @@ public function all(): array * @param string $key * @return mixed|null */ - public function get($key) + public function get(string $key) { return $this->server[$key] ?? null; } @@ -86,7 +86,7 @@ public function has($key): bool * @param string $key * @param mixed $value */ - public function set($key, $value): void + public function set(string $key, $value): void { $this->server[$key] = $value; } diff --git a/src/Mailer/Adapters/SmtpAdapter.php b/src/Mailer/Adapters/SmtpAdapter.php index ba313c03..85c8cee5 100644 --- a/src/Mailer/Adapters/SmtpAdapter.php +++ b/src/Mailer/Adapters/SmtpAdapter.php @@ -50,7 +50,7 @@ public function __construct(array $params) if (config()->get('debug')) { $this->mailer->SMTPDebug = SMTP::DEBUG_SERVER; - $this->mailer->Debugoutput = function ($message): void { + $this->mailer->Debugoutput = function (string $message): void { warning($message, ['tab' => Debugger::MAILS]); }; } diff --git a/src/Service/Factories/ServiceFactory.php b/src/Service/Factories/ServiceFactory.php index 8e78578d..b800fbe0 100644 --- a/src/Service/Factories/ServiceFactory.php +++ b/src/Service/Factories/ServiceFactory.php @@ -1,5 +1,7 @@