Repository navigation
Themes: Call static process_blocks_custom_css() statically in WP_Theme_JSON - #16093
westonruter wants to merge 1 commit into
Conversation
WP_Theme_JSON::process_blocks_custom_css() is declared public static, but three call sites invoked it as $this->process_blocks_custom_css(), while two others already use static::. Use static:: for all of them. Behavior is unchanged, since both forms resolve with late static binding. Co-Authored-By: Claude Opus 5.5 (medium effort) <noreply@anthropic.com> Claude-Code-Session-Id: dd6ba841-fda3-4a15-8474-62f4e9285131
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
The `WP_Theme_JSON::process_blocks_custom_css()` method is declared static, yet three of its call sites invoked it through `$this` while the others already used `static::`. Behavior is unchanged, since both forms resolve the method with late static binding. In Gutenberg the same change, made in WordPress/gutenberg#87058, cleared the only errors of the `dynamicCallOnStaticMethod` rule from phpstan-strict-rules, so making it here keeps `WP_Theme_JSON` in sync with its Gutenberg counterpart. Developed in #16093. Follow-up to r55192, r58421. Props noruzzaman, westonruter. See #66739. git-svn-id: https://develop.svn.wordpress.org/trunk@65770 602fd350-edb4-49c9-b593-d223f7449a82
The `WP_Theme_JSON::process_blocks_custom_css()` method is declared static, yet three of its call sites invoked it through `$this` while the others already used `static::`. Behavior is unchanged, since both forms resolve the method with late static binding. In Gutenberg the same change, made in WordPress/gutenberg#87058, cleared the only errors of the `dynamicCallOnStaticMethod` rule from phpstan-strict-rules, so making it here keeps `WP_Theme_JSON` in sync with its Gutenberg counterpart. Developed in WordPress/wordpress-develop#16093. Follow-up to r55192, r58421. Props noruzzaman, westonruter. See #66739. Built from https://develop.svn.wordpress.org/trunk@65770 git-svn-id: http://core.svn.wordpress.org/trunk@64799 1a063a9b-81f0-0310-95a4-ce76da25c4cd
✅ Committed in r65770 (2da24ad).
Backport of:
WP_Theme_JSON::process_blocks_custom_css()is declaredpublic static, but three call sites, one inget_custom_css()and two inget_styles_for_block(), invoke it as$this->process_blocks_custom_css(), while two others inget_styles_for_block()already usestatic::. This changes the three tostatic::as well. Behavior is unchanged, since both forms resolve the method with late static binding.In Gutenberg, the same change lets the
dynamicCallOnStaticMethodrule from phpstan-strict-rules be enabled, since these were its only errors there. Making it here too keepsWP_Theme_JSONin sync withWP_Theme_JSON_Gutenberg.Trac ticket: https://core.trac.wordpress.org/ticket/66739
Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5 (medium effort)
Used for: Porting the change from the Gutenberg PR, running the
WP_Theme_JSONtests, and drafting this description.This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.