- π«π·France andypost
This declares can go away in PHP 9.0 https://externals.io/message/112230#112233
- First commit to issue fork.
- π³πΏNew Zealand quietone
Came across this and I decided to create an MR to see the failures.
- π¦πΊAustralia mstrelan
Good idea @quetone, I had thought about doing the same. I think fixing most of π Fix strict type errors detected by phpstan Active would go a long way to getting this green. From memory there were no reported errors in core/lib/Drupal/Component, so maybe we could try limit to just that area first.
- π³πΏNew Zealand quietone
Seems I didn't do Components in the MR, so I have added that now.
- Status changed to Needs review
about 1 month ago 9:47am 21 April 2025 - π³πΏNew Zealand quietone
There is consensus here that this is a good idea and the standard β for adding the declaration has also been agreed to. So, the policy has been agreed to.
Does this require documentation? If so, where?
FYI, the latest MR added strict types to Components and that is failing. The MR is information only and is not needed to resolve this policy issue.
The Needs Review Queue Bot β tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide β to find step-by-step guides for working with issues.
- π³πΏNew Zealand quietone
As stated in #26, the MR is for information only.
There is one remaining question, where to document?
- πΊπΈUnited States dww
I don't know of any docs specific to "how to write good code for Core" anywhere. π Here are some of the spots I found while searching for a home:
https://www.drupal.org/community/contributor-guide/skill/php-codingprogr... β
https://www.drupal.org/community/contributor-guide/task/create-a-merge-r... βNeither of those are particularly discoverable or exactly relevant.
Probably more likely to be found if we considered this a "Coding standard" not a core-only policy, but that's a bit of a slippery slope.
Maybe we want a new child page under https://www.drupal.org/about/core/policies β for stuff like this. Something like "Core coding policies". Would also be somewhere to document the outcome of π [policy, no patch] Hook classes should not be marked final Active vs. π± Use final to define classes that are NOT extension points Active . We could write up π± [policy, no patch] All new Drupal 10 code should use appropriate type hints wherever possible Needs review there, too.