Invoker icon indicating copy to clipboard operation
Invoker copied to clipboard

Optional-before-required removal in PHP 8.2 should be documented

Open iansltx opened this issue 1 year ago • 2 comments

This isn't really an issue of Invoker, but should_invoke_callable_with_optional_parameter_before_required_parameter fails on PHP 8.2 due to PHP tightening up optional-before-required param behavior. If that's desired functionality in Invoker even >= PHP 8.2 OTOH, code changes will be required. But skipping that test on 8.2, documenting the change, and updating the test grid to include 8.1 and 8.2, seems like a reasonable enough response from here.

iansltx avatar Jul 06 '23 19:07 iansltx

Thanks, good points!

But skipping that test on 8.2, documenting the change, and updating the test grid to include 8.1 and 8.2, seems like a reasonable enough response from here.

Sounds good, the package shouldn't aim to rewrite native PHP behavior.

mnapoli avatar Jul 09 '23 07:07 mnapoli

This may be what is causing one test to fail on recent php versions

There was 1 error:

1) Invoker\Test\InvokerTest::should_invoke_callable_with_optional_parameter_before_required_parameter
Invoker\Exception\NotEnoughParametersException: Unable to invoke the callable because no value was given for parameter 1 ($baz)

/home/runner/work/Invoker/Invoker/src/Invoker.php:67
/home/runner/work/Invoker/Invoker/tests/InvokerTest.php:[22](https://github.com/williamdes/Invoker/actions/runs/6120452457/job/16612348312#step:6:23)3

Ref: https://github.com/PHP-DI/Invoker/actions/runs/6221070349/job/16882338119

williamdes avatar Sep 18 '23 12:09 williamdes