- Issue created by @mstrelan
- 🇦🇺Australia mstrelan
Thanks for the review. I initially thought about addressing the missing return and the type hints but figured it was out of scope, since arguably we don't necessarily need to change the existing set_error_handler calls in the first place. The reference would make sense to address though. If we are going to refactor the anonymous function it would probably make sense to make it a static method on the Error class, since we're repeating it 4 times.
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.
- 🇦🇺Australia mstrelan
Rebased and deprecated
\Drupal\Core\Utility\Error::currentErrorHandler
. Let's leave fixing upset_error_handler
calls to another issue so we can consolidate similar callbacks and refine them there. We may need to fix_drupal_error_handler_real
to return an int as per the expected method signature. - 🇦🇺Australia mstrelan
In fact let's use #3000229: Move error handlers to an Error class → to fix the set_error_handler calls
- 🇺🇸United States nicxvan
Do we need to do a dependency evaluation since this adds the polyfill.
Or is it different since this is symfony?
- 🇺🇸United States nicxvan
Just to make sure I understand this only replaced the instances where the error handler is swapped only to find the current handler.
I still have to pull down and confirm it's complete.
- 🇦🇺Australia mstrelan
Do we need to do a dependency evaluation since this adds the polyfill.
Or is it different since this is a symfony library?
I think most symfony libraries would still need one, but not polyfills for php versions. We didn't for
polyfill-php84
in 📌 Compatibility with Symfony 7.3 Active nor forpolyfill-php83
in 📌 [11.x] [PP-1] Add PHP 8.3 requirement to Drupal 11.0.x Postponed .Just to make sure I understand this only replaced the instances where the error handler is swapped only to find the current handler.
I replaced all calls to
set_error_handler
that used the result, to useget_error_handler
instead. In some cases the callback passed toset_error_handler
only existed so we could get the result. In other cases we were setting the error handler to something else, so we now get and set the handler in separate operations. - 🇺🇸United States nicxvan
Thank you, I asked for confirmation in slack on the dependency.
Other than that I grepped for " = set_error_handler" and confirmed that all items were addressed.
I also confirmed that all instances of currentErrorHandler were replaced and the deprecation looks right.
Once the dependency question is resolved I think this is ready!
- 🇺🇸United States nicxvan
@catch confirmed on slack that polyfills can just be added and removed as needed.
- 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10
We'll need a new hash in the composer.lock after 🐛 phpstan dev constraints make it difficult for modules to support 11.2 and below Active - fine to self RTBC after that
-
larowlan →
committed 3023ed6d on 11.x
Issue #3526515 by mstrelan, nicxvan, mondrake, catch: Use...
-
larowlan →
committed 3023ed6d on 11.x
- 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10
Committed to 11.x and published the change record