Problem/Motivation
When we did #3608929: Adopt php-cs-fixer ruleset, we skipped native_function_invocation to avoid breaking too much MR
We merged many big stuff since (#3548884: SourceValueItem field synchronized translations, #3588936: Drupal 12 compatibility and Symfony Constraint API,#3611167: Escape at render, not in sources (rely on Twig autoescape)..) and it is time to reconsider it.
There is at least 676 native function invocation, in 173 files, and add leading \ before function invocation is speeding up resolving: https://blog.devsense.com/2025/optimize-native-function-invocation/#opti...
For example, phpunits tests run between 2% and 4% faster after the change.
Proposed resolution
- Remove
$rules['native_function_invocation'] = FALSE; - Run php-cs-fixer
Issue fork ui_patterns-3615274
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
pdureau commentedComment #4
pdureau commentedComment #5
pdureau commentedDoing the change, I have noticed
php-cs-fixerwas not playing nice with our last plugin annotation (inComponentFormDisplay), so I converted it to attributes thanks todrupal-rector.Comment #6
grimreaperHi,
Sorry, with the latest big commits, the MR needs to be rebased.
Comment #7
pdureau commentedRebased.
Comment #8
pdureau commentedi will check Florent feedback
Comment #9
pdureau commentedChanges done.
Comment #11
grimreaper