1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 12:55:26 +01:00

fix condition when scalar is allowed

This commit is contained in:
orklah 2021-07-13 00:34:22 +02:00
parent 1fc8982ca9
commit 52033f4b69

View File

@ -1117,6 +1117,7 @@ class ArgumentAnalyzer
if (!$param_type->isFalsable() && if (!$param_type->isFalsable() &&
!$param_type->hasBool() && !$param_type->hasBool() &&
!$param_type->hasScalar() &&
$cased_method_id !== 'echo' && $cased_method_id !== 'echo' &&
$cased_method_id !== 'print' $cased_method_id !== 'print'
) { ) {
@ -1124,7 +1125,7 @@ class ArgumentAnalyzer
if (IssueBuffer::accepts( if (IssueBuffer::accepts(
new InvalidArgument( new InvalidArgument(
'Argument ' . ($argument_offset + 1) . $method_identifier . ' cannot be false, ' . 'Argument ' . ($argument_offset + 1) . $method_identifier . ' cannot be false, ' .
'false value provided', $param_type->getId() . ' value provided',
$arg_location, $arg_location,
$cased_method_id $cased_method_id
), ),
@ -1140,7 +1141,7 @@ class ArgumentAnalyzer
if (IssueBuffer::accepts( if (IssueBuffer::accepts(
new PossiblyFalseArgument( new PossiblyFalseArgument(
'Argument ' . ($argument_offset + 1) . $method_identifier . ' cannot be false, possibly ' . 'Argument ' . ($argument_offset + 1) . $method_identifier . ' cannot be false, possibly ' .
'false value provided', $param_type->getId() . ' value provided',
$arg_location, $arg_location,
$cased_method_id $cased_method_id
), ),