File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1425,6 +1425,12 @@ parameters:
14251425 count : 1
14261426 path : src/Type/IntersectionType.php
14271427
1428+ -
1429+ rawMessage : ' Doing instanceof PHPStan\Type\Enum\EnumCaseObjectType is error-prone and deprecated. Use Type::getEnumCases() instead.'
1430+ identifier : phpstanApi.instanceofType
1431+ count : 1
1432+ path : src/Type/IntersectionType.php
1433+
14281434 -
14291435 rawMessage : Doing instanceof PHPStan\Type\IntersectionType is error-prone and deprecated.
14301436 identifier : phpstanApi.instanceofType
Original file line number Diff line number Diff line change @@ -1345,6 +1345,10 @@ public function getFiniteTypes(): array
13451345 foreach ($ this ->types as $ type ) {
13461346 $ oneType = [];
13471347 foreach ($ type ->getFiniteTypes () as $ finiteType ) {
1348+ if ($ finiteType instanceof EnumCaseObjectType) {
1349+ $ oneType [$ finiteType ->getClassName () . ':: ' . $ finiteType ->getEnumCaseName ()] = $ finiteType ;
1350+ continue ;
1351+ }
13481352 $ oneType [$ finiteType ->describe (VerbosityLevel::typeOnly ())] = $ finiteType ;
13491353 }
13501354 $ compare [] = $ oneType ;
You can’t perform that action at this time.
0 commit comments