Skip to content

Commit

Permalink
Fix after PHPStan update
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Oct 14, 2024
1 parent dd4ef58 commit 0c64181
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion tests/Type/WebMozartAssert/data/bug-117.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Type/WebMozartAssert/data/bug-150.php
Original file line number Diff line number Diff line change
Expand Up @@ -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<mixed, mixed>)", $data);

foreach ($data['sniffs'] as $sniffName) {
Assert::string($sniffName);
Expand Down
4 changes: 2 additions & 2 deletions tests/Type/WebMozartAssert/data/collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,10 @@ public function allKeyExists(array $a, array $b, array $c, $d): void
assertType('array<array{id: int}>', $a);

Assert::allKeyExists($b, 'id');
assertType('array<int, array<string, mixed>&hasOffset(\'id\')>', $b);
assertType('array<int, non-empty-array<string, mixed>&hasOffset(\'id\')>', $b);

Assert::allKeyExists($c, 'id');
assertType('array<array&hasOffset(\'id\')>', $c);
assertType('array<non-empty-array&hasOffset(\'id\')>', $c);
}

/**
Expand Down
20 changes: 10 additions & 10 deletions tests/Type/WebMozartAssert/data/type.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,37 +152,37 @@ public function isCallable($a, $b): void
public function isArray($a, $b): void
{
Assert::isArray($a);
assertType('array', $a);
assertType('array<mixed, mixed>', $a);

Assert::nullOrIsArray($b);
assertType('array|null', $b);
assertType('array<mixed, mixed>|null', $b);
}

public function isTraversable($a, $b): void
{
Assert::isTraversable($a);
assertType('array|Traversable', $a);
assertType('array<mixed, mixed>|Traversable', $a);

Assert::nullOrIsTraversable($b);
assertType('array|Traversable|null', $b);
assertType('array<mixed, mixed>|Traversable|null', $b);
}

public function isIterable($a, $b): void
{
Assert::isIterable($a);
assertType('array|Traversable', $a);
assertType('array<mixed, mixed>|Traversable', $a);

Assert::nullOrIsIterable($b);
assertType('array|Traversable|null', $b);
assertType('array<mixed, mixed>|Traversable|null', $b);
}

public function isCountable($a, $b): void
{
Assert::isCountable($a);
assertType('array|Countable', $a);
assertType('array<mixed, mixed>|Countable', $a);

Assert::nullOrIsCountable($b);
assertType('array|Countable|null', $b);
assertType('array<mixed, mixed>|Countable|null', $b);
}

public function isInstanceOf($a, $b, $c, $d): void
Expand Down Expand Up @@ -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<mixed, mixed>|ArrayAccess', $a);

Assert::nullOrIsArrayAccessible($b);
assertType('array|ArrayAccess|null', $b);
assertType('array<mixed, mixed>|ArrayAccess|null', $b);
}
}

Expand Down

0 comments on commit 0c64181

Please sign in to comment.