Problem/Motivation
Partially supported callables are deprecated in PHP 8.2 but core has some usage to clean-up for compatibility
- https://wiki.php.net/rfc/deprecate_partially_supported_callables
- https://wiki.php.net/rfc/partially-supported-callables-expand-deprecatio...
"self::method" -> self::class . "::method"
"parent::method" -> parent::class . "::method"
"static::method" -> static::class . "::method"
["self", "method"] -> [self::class, "method"]
["parent", "method"] -> [parent::class, "method"]
["static", "method"] -> [static::class, "method"]If compatibility with PHP < 8.1 is not desired, use of the first-class callable syntax self::method(...) is also possible.
This clean-up could be done in #3259716: Replace usages of static::class . '::methodName' to first-class callable syntax static::method(...)
Steps to reproduce
Run \Drupal\Tests\views\Kernel\ModuleTest::testLoadFunctions() on PHP 8.2
https://dispatcher.drupalci.org/job/drupal_patches/138888/testReport/jun...
Unsilenced deprecation notices (10)
10x: Use of "static" in callables is deprecated
10x in ModuleTest::testLoadFunctions from Drupal\Tests\views\KernelProposed resolution
- replace usage with recommended in RFC
- decide about formalization to Callables in #3259716: Replace usages of static::class . '::methodName' to first-class callable syntax static::method(...)
Remaining tasks
patch/review/commit
User interface changes
no
API changes
no
Data model changes
no
Release notes snippet
no
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 3299327-5.patch | 5.64 KB | andypost |
| #5 | interdiff.txt | 562 bytes | andypost |
| #3 | 3299327-3.patch | 5.09 KB | andypost |
Comments
Comment #2
andypostComment #3
andypostthe patch from #3295821-33: Ignore: patch testing issue for PHP 8.2 attributes
Comment #4
berdirThere's one more instance with ['self', '''] in \Drupal\views\ViewsDataHelper::fetchFields.
Comment #5
andypostThanks, missed this one and can't find the message in tests
Comment #6
berdirThanks, not sure if that needs to be self, I guess not, but lets not change that here.
Comment #9
catchYes let's leave the
selfas-is here, not a class that's going to get subclassed anyway, could be a small task follow-up to change.Committed/pushed to 10.1.x and cherry-picked to 10.0.x, thanks!
Comment #10
andypostThank you, filed follow-up #3299890: Refactor views.views_data_helper service usage of self
Comment #12
andypostFiled follow-up for the missed conversion #3309750: Fix callable syntax for PHP 8.2 in Views.php
Comment #13
senzaesclusiva commentedSorry for reopen
Is this the same problem i've founded while checking db tables?
I'm on D10.2.0, MySQL 5.7.39, php 8.2
Many thanks for your answer
Comment #14
rahul_ commentedSame error i am facing with below configration.
PHP 8.2
Drupal 10.2
Drush 8.4.12
Comment #15
berdirThose are from old drush versions and its dependencies, not Drupal core. You need to update drush.
Comment #16
rahul_ commentedwe are already on latest drush
Comment #17
berdirYou are using drush-launcher which is no longer supported, that message might be from that, see https://github.com/drush-ops/drush-launcher.
Comment #18
rahul_ commentedIt is fixed after update Drush Launcher version 0.10.2
https://github.com/drush-ops/drush-launcher/issues/102
Thanks
Comment #19
senzaesclusiva commentedThanks for your all answers
I'm not using the drush-launcer
BTW issues seems to be solved with last update of Drush 12.4.3.0 and Composer 2.6.6
Thanks again