Skip to content

Commit

Permalink
Prevent dupe records
Browse files Browse the repository at this point in the history
  • Loading branch information
muglug committed Oct 19, 2020
1 parent f9deaca commit db119d6
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/Psalm/Type/Reconciler.php
Original file line number Diff line number Diff line change
Expand Up @@ -807,8 +807,6 @@ protected static function triggerIssueForImpossible(
): void {
$not = $assertion[0] === '!';

$safe_assertion = $assertion;

if ($not) {
$assertion = substr($assertion, 1);
}
Expand All @@ -832,7 +830,7 @@ protected static function triggerIssueForImpossible(
. ' for ' . $key
. ' is ' . ($not ? 'never ' : 'always ') . $assertion,
$code_location,
$old_var_type_string . ' ' . $safe_assertion
$old_var_type_string . ' ' . $assertion
),
$suppressed_issues
)) {
Expand All @@ -845,7 +843,7 @@ protected static function triggerIssueForImpossible(
. ' for ' . $key
. ' is ' . ($not ? 'never ' : 'always ') . $assertion,
$code_location,
$old_var_type_string . ' ' . $safe_assertion
$old_var_type_string . ' ' . $assertion
),
$suppressed_issues
)) {
Expand All @@ -860,7 +858,7 @@ protected static function triggerIssueForImpossible(
. ' for ' . $key
. ' is ' . ($not ? 'always ' : 'never ') . $assertion,
$code_location,
$old_var_type_string . ' ' . $safe_assertion
$old_var_type_string . ' ' . $assertion
),
$suppressed_issues
)) {
Expand All @@ -873,15 +871,15 @@ protected static function triggerIssueForImpossible(
. ' for ' . $key
. ' is never ' . $assertion,
$code_location,
$old_var_type_string . ' ' . $safe_assertion
$old_var_type_string . ' ' . $assertion
);
} else {
$issue = new TypeDoesNotContainType(
'Type ' . $old_var_type_string
. ' for ' . $key
. ' is ' . ($not ? 'always ' : 'never ') . $assertion,
$code_location,
$old_var_type_string . ' ' . $safe_assertion
$old_var_type_string . ' ' . $assertion
);
}

Expand Down

0 comments on commit db119d6

Please sign in to comment.