Skip to content

Commit ea39dd5

Browse files
committed
Tests: update RuntimeTest
1 parent c00dc21 commit ea39dd5

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

phpstan.neon

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -972,6 +972,12 @@ parameters:
972972
count: 1
973973
path: tests/RuntimeTest.php
974974

975+
-
976+
rawMessage: 'Call to static method Forrest79\TypeValidator::isType() with array{foo: 1} and ''array{foo: int, bar…'' will always evaluate to true.'
977+
identifier: staticMethod.alreadyNarrowedType
978+
count: 1
979+
path: tests/RuntimeTest.php
980+
975981
-
976982
rawMessage: 'Call to static method Forrest79\TypeValidator::isType() with array{key: 1, 0: 2} and ''associative-array'' will always evaluate to true.'
977983
identifier: staticMethod.alreadyNarrowedType

tests/RuntimeTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ private static function testArrayType(): void
255255
assert(TypeValidator::isType([1, 3], 'array{0: int, 1: int}'));
256256
assert(!TypeValidator::isType(1, 'array{foo: int, bar: string}'));
257257
assert(!TypeValidator::isType(['foo' => 1], 'array{foo: int, bar: string}'));
258+
assert(TypeValidator::isType(['foo' => 1], 'array{foo: int, bar?: string}'));
258259
assert(!TypeValidator::isType(['foo' => '1'], 'array{foo: int}'));
259260

260261
// Generic

0 commit comments

Comments
 (0)