mirror of
https://github.com/danog/psalm.git
synced 2025-01-22 05:41:20 +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,
|
$entry_clauses,
|
||||||
$case_clauses,
|
$case_clauses,
|
||||||
$statements_checker,
|
$statements_checker,
|
||||||
$stmt->cond,
|
$case,
|
||||||
[]
|
[]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -610,7 +610,7 @@ class SwitchTypeTest extends TestCase
|
|||||||
case 0:
|
case 0:
|
||||||
echo "I never get here";
|
echo "I never get here";
|
||||||
}',
|
}',
|
||||||
'error_message' => 'ParadoxicalCondition',
|
'error_message' => 'ParadoxicalCondition - src/somefile.php:7',
|
||||||
],
|
],
|
||||||
'impossibleCaseValue' => [
|
'impossibleCaseValue' => [
|
||||||
'<?php
|
'<?php
|
||||||
@ -626,7 +626,7 @@ class SwitchTypeTest extends TestCase
|
|||||||
case "c":
|
case "c":
|
||||||
echo "impossible";
|
echo "impossible";
|
||||||
}',
|
}',
|
||||||
'error_message' => 'TypeDoesNotContainType',
|
'error_message' => 'TypeDoesNotContainType - src/somefile.php:11',
|
||||||
],
|
],
|
||||||
'impossibleCaseDefault' => [
|
'impossibleCaseDefault' => [
|
||||||
'<?php
|
'<?php
|
||||||
@ -642,7 +642,7 @@ class SwitchTypeTest extends TestCase
|
|||||||
default:
|
default:
|
||||||
echo "impossible";
|
echo "impossible";
|
||||||
}',
|
}',
|
||||||
'error_message' => 'ParadoxicalCondition',
|
'error_message' => 'ParadoxicalCondition - src/somefile.php:11',
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user