1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00
This commit is contained in:
orklah 2022-02-12 21:40:51 +01:00
parent 954884eb48
commit 9cc82d55f7

View File

@ -382,6 +382,29 @@ class EnumTest extends TestCase
'ignored_issues' => [],
'php_version' => '8.1',
],
'EnumCollapsing' => [
'code' => '<?php
enum Code: int
{
case Ok = 0;
case Fatal = 1;
}
function foo(): int|Code|null
{
return null;
}
$code = foo();
if(!isset($code)){
$code = Code::Ok;
}',
'assertions' => [
'$code' => 'Code|int',
],
'ignored_issues' => [],
'php_version' => '8.1',
],
];
}