Skip to content

Commit 9c20b50

Browse files
committed
Fixed some Psalm issues
1 parent 18cb355 commit 9c20b50

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
* @package App\Tests\Unit\Utils\Tests
@@ -64,13 +65,16 @@ public function testThatGetValidValueReturnsExpectedValue(mixed $expected, strin
6465
{
6566
$value = PhpUnitUtil::getValidValueForType(PhpUnitUtil::getType($input));
6667

68+
/** @var StringableArrayObject|mixed $expected */
6769
$expected = $expected instanceof StringableArrayObject ? $expected->getArrayCopy() : $expected;
6870

6971
if ($strict) {
7072
self::assertSame($expected, $value);
71-
} else {
72-
/** @psalm-var class-string $expected */
73+
} elseif (is_string($expected)) {
74+
/** @var class-string $expected */
7375
self::assertInstanceOf($expected, $value);
76+
} else {
77+
throw new LogicException('This should not happen...');
7478
}
7579
}
7680

0 commit comments

Comments
 (0)