From 0c641817d2a8f05c7157f92d91986e74d3c8ab0c Mon Sep 17 00:00:00 2001 From: Ondrej Mirtes Date: Mon, 14 Oct 2024 05:45:26 +0200 Subject: [PATCH] Fix after PHPStan update --- tests/Type/WebMozartAssert/data/bug-117.php | 2 +- tests/Type/WebMozartAssert/data/bug-150.php | 2 +- .../Type/WebMozartAssert/data/collection.php | 4 ++-- tests/Type/WebMozartAssert/data/type.php | 20 +++++++++---------- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/Type/WebMozartAssert/data/bug-117.php b/tests/Type/WebMozartAssert/data/bug-117.php index 501ee04..635f100 100644 --- a/tests/Type/WebMozartAssert/data/bug-117.php +++ b/tests/Type/WebMozartAssert/data/bug-117.php @@ -46,7 +46,7 @@ public function getData(int $accountId, array $requestData): array $requestData['accountId'] = $accountId; - assertType("hasOffsetValue('accountId', int)&hasOffsetValue('errorColor', string|null)&hasOffsetValue('theme', array&hasOffsetValue('backgroundColor', string|null)&hasOffsetValue('headerImage', (array&hasOffsetValue('id', int))|null)&hasOffsetValue('textColor', string|null))&non-empty-array", $requestData); + assertType("non-empty-array&hasOffsetValue('accountId', int)&hasOffsetValue('errorColor', string|null)&hasOffsetValue('theme', non-empty-array&hasOffsetValue('backgroundColor', string|null)&hasOffsetValue('headerImage', (non-empty-array&hasOffsetValue('id', int))|null)&hasOffsetValue('textColor', string|null))", $requestData); return $requestData; } diff --git a/tests/Type/WebMozartAssert/data/bug-150.php b/tests/Type/WebMozartAssert/data/bug-150.php index e2bb4fa..22efe5a 100644 --- a/tests/Type/WebMozartAssert/data/bug-150.php +++ b/tests/Type/WebMozartAssert/data/bug-150.php @@ -13,7 +13,7 @@ public function doFoo($data): void Assert::isArray($data); Assert::keyExists($data, 'sniffs'); Assert::isArray($data['sniffs']); - assertType("array&hasOffsetValue('sniffs', array)", $data); + assertType("non-empty-array&hasOffsetValue('sniffs', array)", $data); foreach ($data['sniffs'] as $sniffName) { Assert::string($sniffName); diff --git a/tests/Type/WebMozartAssert/data/collection.php b/tests/Type/WebMozartAssert/data/collection.php index a853731..73eaab2 100644 --- a/tests/Type/WebMozartAssert/data/collection.php +++ b/tests/Type/WebMozartAssert/data/collection.php @@ -155,10 +155,10 @@ public function allKeyExists(array $a, array $b, array $c, $d): void assertType('array', $a); Assert::allKeyExists($b, 'id'); - assertType('array&hasOffset(\'id\')>', $b); + assertType('array&hasOffset(\'id\')>', $b); Assert::allKeyExists($c, 'id'); - assertType('array', $c); + assertType('array', $c); } /** diff --git a/tests/Type/WebMozartAssert/data/type.php b/tests/Type/WebMozartAssert/data/type.php index 9216966..9960eed 100644 --- a/tests/Type/WebMozartAssert/data/type.php +++ b/tests/Type/WebMozartAssert/data/type.php @@ -152,37 +152,37 @@ public function isCallable($a, $b): void public function isArray($a, $b): void { Assert::isArray($a); - assertType('array', $a); + assertType('array', $a); Assert::nullOrIsArray($b); - assertType('array|null', $b); + assertType('array|null', $b); } public function isTraversable($a, $b): void { Assert::isTraversable($a); - assertType('array|Traversable', $a); + assertType('array|Traversable', $a); Assert::nullOrIsTraversable($b); - assertType('array|Traversable|null', $b); + assertType('array|Traversable|null', $b); } public function isIterable($a, $b): void { Assert::isIterable($a); - assertType('array|Traversable', $a); + assertType('array|Traversable', $a); Assert::nullOrIsIterable($b); - assertType('array|Traversable|null', $b); + assertType('array|Traversable|null', $b); } public function isCountable($a, $b): void { Assert::isCountable($a); - assertType('array|Countable', $a); + assertType('array|Countable', $a); Assert::nullOrIsCountable($b); - assertType('array|Countable|null', $b); + assertType('array|Countable|null', $b); } public function isInstanceOf($a, $b, $c, $d): void @@ -300,10 +300,10 @@ public function isNotA(object $a, string $b, ?object $c): void public function isArrayAccessible($a, $b): void { Assert::isArrayAccessible($a); - assertType('array|ArrayAccess', $a); + assertType('array|ArrayAccess', $a); Assert::nullOrIsArrayAccessible($b); - assertType('array|ArrayAccess|null', $b); + assertType('array|ArrayAccess|null', $b); } }