diff --git a/phpstan.neon b/phpstan.neon index e9e666d..ffc7ccf 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,5 +1,6 @@ parameters: - level: 5 + level: 8 + checkMissingIterableValueType: false errorFormat: raw paths: 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;