Skip to content

Commit 7e6d316

Browse files
committed
Address phpstan issues
1 parent 8cffcb2 commit 7e6d316

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/Framework/Assert.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1770,7 +1770,7 @@ final public static function assertNotSame(mixed $expected, mixed $actual, strin
17701770
*
17711771
* @throws ExpectationFailedException
17721772
*/
1773-
final public static function assertSameDictionaryKeysValues(array $expected, array $actual, string $message = ''): void
1773+
final public static function assertSameDictionaryKeysValues(mixed $expected, mixed $actual, string $message = ''): void
17741774
{
17751775
self::assertThat(
17761776
$actual,

src/Framework/Constraint/Dictionary/IsIdenticalKeysValues.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,15 @@ public function __construct(mixed $value)
4646
*
4747
* @throws ExpectationFailedException
4848
*/
49-
public function evaluate(mixed $other, string $description = '', bool $returnResult = false): ?bool
49+
public function evaluate(mixed $other, string $description = '', bool $returnResult = false): bool
5050
{
5151
assert(is_array($this->value));
5252
assert(is_array($other));
5353

5454
// cribbed from `src/Framework/Constraint/Equality/IsEqualCanonicalizing.php`
5555
try {
5656
$this->compareDictionary($this->value, $other);
57+
5758
} catch (ComparisonFailure $f) {
5859
if ($returnResult) {
5960
return false;
@@ -64,7 +65,6 @@ public function evaluate(mixed $other, string $description = '', bool $returnRes
6465
$f,
6566
);
6667
}
67-
6868
return true;
6969
}
7070

@@ -80,6 +80,7 @@ public function toString(): string
8080
* cribbed from `vendor/sebastian/comparator/src/ArrayComparator.php`
8181
* This potentially should be a dictionarycomparator or type-strict arraycomparator.
8282
*/
83+
/** @phpstan-ignore missingType.iterableValue, missingType.iterableValue, missingType.iterableValue */
8384
private function compareDictionary(array $expected, array $actual, array &$processed = []): void
8485
{
8586
$remaining = $actual;
@@ -204,6 +205,7 @@ private function compareDictionary(array $expected, array $actual, array &$proce
204205
* cribbed from `vendor/sebastian/comparator/src/ObjectComparator.php`
205206
* this potentially should be a type-strict objectcomparator.
206207
*/
208+
/** @phpstan-ignore missingType.iterableValue */
207209
private function compareObjects(object $expected, object $actual, array &$processed = []): void
208210
{
209211
if ($actual::class !== $expected::class) {
@@ -251,6 +253,7 @@ private function compareObjects(object $expected, object $actual, array &$proces
251253
/**
252254
* cribbed from `vendor/sebastian/comparator/src/ObjectComparator.php`.
253255
*/
256+
/** @phpstan-ignore missingType.iterableValue */
254257
private function toArray(object $object): array
255258
{
256259
return (new Exporter)->toArray($object);

0 commit comments

Comments
 (0)