1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-21 21:31:13 +01:00

Improve reporting of duplicate case statements

This commit is contained in:
Matthew Brown 2018-05-13 22:02:10 -04:00
parent 5c1726cece
commit 05c3d1ab03
2 changed files with 4 additions and 4 deletions

View File

@ -257,7 +257,7 @@ class SwitchChecker
$entry_clauses,
$case_clauses,
$statements_checker,
$stmt->cond,
$case,
[]
);

View File

@ -610,7 +610,7 @@ class SwitchTypeTest extends TestCase
case 0:
echo "I never get here";
}',
'error_message' => 'ParadoxicalCondition',
'error_message' => 'ParadoxicalCondition - src/somefile.php:7',
],
'impossibleCaseValue' => [
'<?php
@ -626,7 +626,7 @@ class SwitchTypeTest extends TestCase
case "c":
echo "impossible";
}',
'error_message' => 'TypeDoesNotContainType',
'error_message' => 'TypeDoesNotContainType - src/somefile.php:11',
],
'impossibleCaseDefault' => [
'<?php
@ -642,7 +642,7 @@ class SwitchTypeTest extends TestCase
default:
echo "impossible";
}',
'error_message' => 'ParadoxicalCondition',
'error_message' => 'ParadoxicalCondition - src/somefile.php:11',
],
];
}