Problem/Motivation
These mostly refer to PHP native classes, could be fixed for PHP 8.1.
Proposed resolution
Add the relevant typehints and remove entry from .deprecation-ignore.txt
Issue fork drupal-3425337
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:
- 3425337-11.x-replace-root
changes, plain diff MR !6887
Comments
Comment #3
quietone commentedComment #4
mondrakeComment #5
mondrakeComment #6
mondrakeComment #7
smustgrave commentedTypehints make sense. Removing from deprecation-ignore didn't cause failures, which I find is a good sign for these kind of tickets.
Comment #9
longwaveNice to see these finally all have their correct types.
Committed ff7c5de and pushed to 11.x. Thanks!
Comment #11
catchThis is causing unit tests to fail with a deprecation warning https://git.drupalcode.org/project/drupal/-/jobs/978330 Not sure how the pipeline here passed, maybe a cross-commit?
Comment #13
catchReverted - let's try again.
Comment #15
mondrakeDeprecation of the DebugClassLoader are very fragile... also noticed that in #3417066: Upgrade PHPUnit to 10, drop Symfony PHPUnit-bridge dependency, where by filling the gap of symfony-bridge I found more errors reported. The strange thing here is that this appears to have dfferent behaviour in MR testing vs branch testing...
Comment #16
mondrakeI rebased and checked, the error reported in #11 was fixed in the MR already, so 🤷
Comment #18
longwaveMaybe I missed it somehow when I committed?! Trying again...
Comment #19
longwaveShould we have another issue to remove all remaining
#[ReturnTypeWillChange]in 11.x?Comment #20
mondrakeIndeed, some seem not to have been reported... I will check with #3417066: Upgrade PHPUnit to 10, drop Symfony PHPUnit-bridge dependency. Sure we need a followup.
Comment #21
catchIf I run this test locally:
I get
Comment #22
tedbow@catch just found this too
I found this issue because for some reason gitlabci started to test with 8.3 when we were testing the Automatic Updates module with core 11.x
In the commit
I think this will cause an error on PHP 8.3 because
ReflectionClass::getStaticProperties(): ?arraywas changed toReflectionClass::getStaticProperties(): arrayso removing the `ReturnTypeWillChange` actually makes this not compatible with PHP 8.3's return type. I couldn't tell if core itself or this merge request was tested on PHP 8.3(still getting use to the gitlab pipelines UI) but looks like 11.x should support PHP 8.3, correct?Comment #23
mondrakeNotice is right, the signature is
public ReflectionClass::getStaticProperties(): array, https://www.php.net/manual/it/reflectionclass.getstaticproperties.phpWill fix it in #3425537: Fix remaining methods with #[\ReturnTypeWillChange] attribute that is still to be committed.
Comment #24
andypostMaybe it's time to enable 8.3 as default for 11.x?
Comment #25
longwaveYep we already agreed #3330874: [11.x] [policy] Require PHP 8.3 for Drupal 11 we should change this in 11.x now.
Comment #26
mondrakeI think this needs to be temporarily reverted, and #3400984: Make PHP 8.3 the default environment for gitlab CI runs done first. BTW there’s a sorting test that fails on PHP 8.3 and I think it’s unrelated.
Comment #27
longwave@mondrake was watching your test runs on the other issue and have come to the same conclusion.
Comment #29
mondrakeSeems OK now after the PHP 8.3 bump in CI
Comment #30
longwaveThird time lucky. Now we are testing on PHP 8.3 I think this is finally OK!
Committed f330fa3 and pushed to 11.x. Thanks!