From 6f1dd230c204ce9323c698ac6e30872cfa386735 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Tvrd=C3=ADk?= Date: Wed, 8 Mar 2023 12:57:30 +0100 Subject: [PATCH] increase phpstan level to 8 [Closes #54] --- phpstan.neon | 3 ++- src/Schema/Message.php | 4 +++- src/Schema/Processor.php | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/phpstan.neon b/phpstan.neon index 8a634ad..9239b06 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,5 +1,6 @@ parameters: - level: 5 + level: 8 + checkMissingIterableValueType: false paths: - src diff --git a/src/Schema/Message.php b/src/Schema/Message.php index ac7eeda..4e976d0 100644 --- a/src/Schema/Message.php +++ b/src/Schema/Message.php @@ -9,6 +9,8 @@ namespace Nette\Schema; +use Nette; + final class Message { @@ -91,6 +93,6 @@ public function toString(): string return preg_replace_callback('~( ?)%(\w+)%~', function ($m) use ($vars) { [, $space, $key] = $m; return $vars[$key] === null ? '' : $space . $vars[$key]; - }, $this->message); + }, $this->message) ?? throw new Nette\InvalidStateException(preg_last_error_msg()); } } diff --git a/src/Schema/Processor.php b/src/Schema/Processor.php index 073c17b..3290ba6 100644 --- a/src/Schema/Processor.php +++ b/src/Schema/Processor.php @@ -18,7 +18,7 @@ final class Processor { public array $onNewContext = []; - private ?Context $context; + private Context $context; private bool $skipDefaults = false;