Skip to content

Commit

Permalink
Improve provider non-optional argument phrasing
Browse files Browse the repository at this point in the history
I just ran across a case where I added an argument to a test method and forgot to give it a default value, and this made all previous arguments with defaults non-optional. The phrasing here confused me because I could clearly see that the argument it was complaining about had a default value, and it took me a while to find the actual issue that I forgot to add a default value to the new argument.
  • Loading branch information
AndrolGenhald authored Feb 11, 2022
1 parent 5dd3be0 commit 02a9ac7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Hooks/TestCaseHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ static function (
} elseif ($potential_argument_type->possibly_undefined && !$is_optional) {
IssueBuffer::accepts(new Issue\InvalidArgument(
'Argument ' . ($param_offset + 1) . ' of ' . $method_name
. ' has no default value, but possibly undefined '
. ' is not optional, but possibly undefined '
. $potential_argument_type->getId() . ' provided'
. ' by ' . $provider_method_id . '():(' . $provider_return_type_string . ')',
$provider_docblock_location
Expand Down

0 comments on commit 02a9ac7

Please sign in to comment.