From 2270a6bc766193101a5f4d4e201257e5c4b56d47 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Mon, 24 Mar 2025 14:49:33 +0100 Subject: [PATCH] Fix test expectations --- composer.json | 2 +- tests/Type/Nette/data/strings-match.php | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.json b/composer.json index 3bedd43..2a3630f 100644 --- a/composer.json +++ b/composer.json @@ -7,7 +7,7 @@ ], "require": { "php": "^7.4 || ^8.0", - "phpstan/phpstan": "^2.1.3" + "phpstan/phpstan": "^2.1.11" }, "conflict": { "nette/application": "<2.3.0", diff --git a/tests/Type/Nette/data/strings-match.php b/tests/Type/Nette/data/strings-match.php index be205de..87ea3e4 100644 --- a/tests/Type/Nette/data/strings-match.php +++ b/tests/Type/Nette/data/strings-match.php @@ -9,19 +9,19 @@ function (string $s): void { $result = Strings::match($s, '/%env\((.*)\:.*\)%/U'); - assertType('array{string, string}|null', $result); + assertType('array{non-falsy-string, string}|null', $result); $result = Strings::match($s, '/%env\((.*)\:.*\)%/U'); - assertType('array{string, string}|null', $result); + assertType('array{non-falsy-string, string}|null', $result); $result = Strings::match($s, '/(foo)(bar)(baz)/', PREG_OFFSET_CAPTURE); - assertType("array{array{string, int<-1, max>}, array{'foo', int<-1, max>}, array{'bar', int<-1, max>}, array{'baz', int<-1, max>}}|null", $result); + assertType("array{array{non-falsy-string, int<-1, max>}, array{'foo', int<-1, max>}, array{'bar', int<-1, max>}, array{'baz', int<-1, max>}}|null", $result); $result = Strings::match($s, '/(foo)(bar)(baz)/'); - assertType("array{string, 'foo', 'bar', 'baz'}|null", $result); + assertType("array{non-falsy-string, 'foo', 'bar', 'baz'}|null", $result); $result = Strings::match($s, '/(foo)(bar)'. preg_quote($s) .'(baz)/'); - assertType("array{string, 'foo', 'bar', 'baz'}|null", $result); + assertType("array{non-falsy-string, 'foo', 'bar', 'baz'}|null", $result); }; function (string $s): void {