Skip to content

Commit

Permalink
add ", but" for InvalidArgument error message where a type is provided
Browse files Browse the repository at this point in the history
  • Loading branch information
kkmuffme committed Aug 3, 2022
1 parent 6998fab commit 652aa03
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
Expand Up @@ -181,7 +181,7 @@ public static function checkArgumentMatches(
IssueBuffer::maybeAdd(
new InvalidLiteralArgument(
'Argument ' . ($argument_offset + 1) . ' of ' . $cased_method_id
. ' expects a non-literal value, ' . $arg_value_type->getId() . ' provided',
. ' expects a non-literal value, but ' . $arg_value_type->getId() . ' provided',
new CodeLocation($statements_analyzer->getSource(), $arg->value),
$cased_method_id
),
Expand Down Expand Up @@ -976,7 +976,7 @@ public static function verifyType(
IssueBuffer::maybeAdd(
new MixedArgumentTypeCoercion(
'Argument ' . ($argument_offset + 1) . $method_identifier . ' expects ' . $param_type->getId() .
', parent type ' . $input_type->getId() . ' provided',
', but parent type ' . $input_type->getId() . ' provided',
$arg_location,
$cased_method_id,
$origin_location
Expand All @@ -987,7 +987,7 @@ public static function verifyType(
IssueBuffer::maybeAdd(
new ArgumentTypeCoercion(
'Argument ' . ($argument_offset + 1) . $method_identifier . ' expects ' . $param_type->getId() .
', parent type ' . $input_type->getId() . ' provided',
', but parent type ' . $input_type->getId() . ' provided',
$arg_location,
$cased_method_id
),
Expand All @@ -1000,7 +1000,7 @@ public static function verifyType(
IssueBuffer::maybeAdd(
new ImplicitToStringCast(
'Argument ' . ($argument_offset + 1) . $method_identifier . ' expects ' .
$param_type->getId() . ', ' . $input_type->getId() . ' provided with a __toString method',
$param_type->getId() . ', but ' . $input_type->getId() . ' provided with a __toString method',
$arg_location
),
$statements_analyzer->getSuppressedIssues()
Expand All @@ -1022,7 +1022,7 @@ public static function verifyType(
IssueBuffer::maybeAdd(
new InvalidScalarArgument(
'Argument ' . ($argument_offset + 1) . $method_identifier . ' expects ' .
$param_type->getId() . ', ' . $type . ' provided',
$param_type->getId() . ', but ' . $type . ' provided',
$arg_location,
$cased_method_id
),
Expand All @@ -1033,7 +1033,7 @@ public static function verifyType(
IssueBuffer::maybeAdd(
new PossiblyInvalidArgument(
'Argument ' . ($argument_offset + 1) . $method_identifier . ' expects ' . $param_type->getId() .
', possibly different type ' . $type . ' provided',
', but possibly different type ' . $type . ' provided',
$arg_location,
$cased_method_id
),
Expand All @@ -1043,7 +1043,7 @@ public static function verifyType(
IssueBuffer::maybeAdd(
new InvalidArgument(
'Argument ' . ($argument_offset + 1) . $method_identifier . ' expects ' . $param_type->getId() .
', ' . $type . ' provided',
', but ' . $type . ' provided',
$arg_location,
$cased_method_id
),
Expand Down
Expand Up @@ -893,7 +893,7 @@ private static function checkClosureTypeArgs(
IssueBuffer::maybeAdd(
new MixedArgumentTypeCoercion(
'Parameter ' . ($i + 1) . ' of closure passed to function ' . $method_id . ' expects ' .
$closure_param_type->getId() . ', parent type ' . $input_type->getId() . ' provided',
$closure_param_type->getId() . ', but parent type ' . $input_type->getId() . ' provided',
new CodeLocation($statements_analyzer->getSource(), $closure_arg),
$method_id
),
Expand All @@ -903,7 +903,7 @@ private static function checkClosureTypeArgs(
IssueBuffer::maybeAdd(
new ArgumentTypeCoercion(
'Parameter ' . ($i + 1) . ' of closure passed to function ' . $method_id . ' expects ' .
$closure_param_type->getId() . ', parent type ' . $input_type->getId() . ' provided',
$closure_param_type->getId() . ', but parent type ' . $input_type->getId() . ' provided',
new CodeLocation($statements_analyzer->getSource(), $closure_arg),
$method_id
),
Expand All @@ -923,7 +923,7 @@ private static function checkClosureTypeArgs(
IssueBuffer::maybeAdd(
new InvalidScalarArgument(
'Parameter ' . ($i + 1) . ' of closure passed to function ' . $method_id . ' expects ' .
$closure_param_type->getId() . ', ' . $input_type->getId() . ' provided',
$closure_param_type->getId() . ', but ' . $input_type->getId() . ' provided',
new CodeLocation($statements_analyzer->getSource(), $closure_arg),
$method_id
),
Expand All @@ -933,7 +933,7 @@ private static function checkClosureTypeArgs(
IssueBuffer::maybeAdd(
new PossiblyInvalidArgument(
'Parameter ' . ($i + 1) . ' of closure passed to function ' . $method_id . ' expects '
. $closure_param_type->getId() . ', possibly different type '
. $closure_param_type->getId() . ', but possibly different type '
. $input_type->getId() . ' provided',
new CodeLocation($statements_analyzer->getSource(), $closure_arg),
$method_id
Expand All @@ -943,7 +943,7 @@ private static function checkClosureTypeArgs(
} elseif (IssueBuffer::accepts(
new InvalidArgument(
'Parameter ' . ($i + 1) . ' of closure passed to function ' . $method_id . ' expects ' .
$closure_param_type->getId() . ', ' . $input_type->getId() . ' provided',
$closure_param_type->getId() . ', but ' . $input_type->getId() . ' provided',
new CodeLocation($statements_analyzer->getSource(), $closure_arg),
$method_id
),
Expand Down

0 comments on commit 652aa03

Please sign in to comment.