Problem/Motivation
Code was added in #2982949: Introduce CallableResolver to help standardise the DX and error handling for callbacks across various subsystems
The code fails on PHP 8.4 as the cause of PHP 8.3 RFC https://wiki.php.net/rfc/deprecate_functions_with_overloaded_signatures
Steps to reproduce
class my {
function fu() {}
}
var_dump(new \ReflectionMethod('my::fu'));
var_dump(\ReflectionMethod::createFromMethodName('my::fu'));
Proposed resolution
As deprecation already in action and no other usages left using https://github.com/nette/di/commit/a548b1cfce285ced0f48cd046c10170349a15a3e
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Issue fork drupal-3444264
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
andypostComment #3
andypostComment #5
andypostComment #6
andypostMajor as the RFC was already fixed for 8.3 compatibility
Comment #7
andypostComment #8
smustgrave commentedSeems straight forward.
Should it be tagged 8.4 though?
Comment #9
andypostNo, this change was applied since 8.3 but the pointed issue did not check that
Comment #10
alexpottCommitted and pushed aa2830b3b1 to 11.x and 40898b6120 to 10.3.x. Thanks!
Comment #12
alexpottComment #15
longwaveReverted this, as PHPStan complains in 10.3.x:
Also in 11.x we don't need the
PHP_VERSION_IDcheck, the minimum is PHP 8.3 there.Comment #18
xjmBetter status I guess; it needs to be built for the branch rather than cherry-picked.
Comment #19
xjmCrossposted with the 11.x revert.
Comment #20
alexpottBah - PHPStan should be able to work out the version check... anyhow +1 for the reverts... typically that something that seems simple turns out to not.
Comment #21
andypostMaybe phpstan is not using 8.3 as minimally allowed, otherwise how it possible?
Ref the failed job https://git.drupalcode.org/project/drupal/-/jobs/1481141
Comment #22
andyposthttps://www.php.net/manual/en/reflectionmethod.createfrommethodname
since 8.3, and the RFC, probably the issue in phpstan but 11.x surely should not have condition
Comment #24
andypostThat's a bug https://phpstan.org/r/9aff1e0d-c4d5-4d48-88fb-b0ae0ec482db
Comment #26
andypostreported upstream https://github.com/phpstan/phpstan/issues/10954
Comment #27
andypostadded to exclude meantime and it now it needs 10.4.x I bet
Comment #28
andypostMaintainers suggested https://github.com/phpstan/phpstan/issues/10954#issuecomment-2088522792
https://phpstan.org/r/690e2da6-8ad3-4f61-9442-d22971dc836d
Comment #31
smustgrave commentedShould this be marked fixed?
Comment #32
alexpott@smustgrave nope - the messages on the issue about reverts and commits from 11.0.x are the wrong way around.
Comment #33
alexpottCommitted and pushed 152b7f0694 to 11.x and a6b7ab7388 to 11.0.x. Thanks!
Committed 9c5eeca and pushed to 10.4.x. Thanks!
Committed 6871694 and pushed to 10.3.x. Thanks!
I don't think we should do the suggestion with method exists as this is called a lot - so doing the ignore in PHPStan and the version check in 10.x seems fine.
Comment #40
andypostThank you!