Skip to content

Commit bdfc2e5

Browse files
committed
Fixed some Psalm issues
1 parent 6624302 commit bdfc2e5

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/Unit/Utils/Tests/PHPUnitUtilTest.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use stdClass;
2121
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
2222
use Throwable;
23+
use function is_string;
2324

2425
/**
2526
* Class PHPUnitUtilTest
@@ -66,13 +67,16 @@ public function testThatGetValidValueReturnsExpectedValue(mixed $expected, strin
6667
{
6768
$value = PhpUnitUtil::getValidValueForType(PhpUnitUtil::getType($input));
6869

70+
/** @var StringableArrayObject|mixed $expected */
6971
$expected = $expected instanceof StringableArrayObject ? $expected->getArrayCopy() : $expected;
7072

7173
if ($strict) {
7274
self::assertSame($expected, $value);
73-
} else {
74-
/** @psalm-var class-string $expected */
75+
} elseif (is_string($expected)) {
76+
/** @var class-string $expected */
7577
self::assertInstanceOf($expected, $value);
78+
} else {
79+
throw new LogicException('This should not happen...');
7680
}
7781
}
7882

0 commit comments

Comments
 (0)