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:
parent
5c1726cece
commit
05c3d1ab03
@ -257,7 +257,7 @@ class SwitchChecker
|
||||
$entry_clauses,
|
||||
$case_clauses,
|
||||
$statements_checker,
|
||||
$stmt->cond,
|
||||
$case,
|
||||
[]
|
||||
);
|
||||
|
||||
|
@ -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',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user