-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
get_style_nodes should be compatible with parent method. #41217
Conversation
Thanks for adding this patch @torounit I just added some minor formatting changes to kick the CI tests off again 😄 The changes in 323174a#diff-f28aa79997745a4a51f917012b45a809c9b45d55134b55379a718f5c751dddf4R160 removed the use of 124 | WARNING | Unused function parameter $selectors. Do we throw in an ignore comment to suppress the warning? protected static function get_style_nodes( $theme_json, $selectors = array() ) { //phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
... That would be an interim measure only, and not ideal. I wonder if we should rather wind back the optimization to dedupe the code in Basically we put up with duplicated code in The other, harder way, might be to create a new function and deprecate What do you think @scruffian ? |
Actually, passing an optional |
I threw up a PR over in #41218 in order to add a check that avoids the PHPCodeSniffer error Fatal error: Uncaught TypeError: vsprintf(): Argument #2 ($values) must be of type array, string given in /app/vendor/squizlabs/php_codesniffer/src/Files/File.php:1056 |
Co-authored-by: Andrew Serong <14988353+andrewserong@users.noreply.github.com>
Thanks for spotting that space in bebac4c @andrewserong 🤞 this one passes. I'll close my other test PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missed the ping but this is 👌🏻 For a moment I wondered if we want to remove |
…p-tests-config * 'trunk' of github.com:WordPress/gutenberg: (88 commits) Components: refactor `AlignmentMatrixControl` to pass `exhaustive-deps` (#41167) [RNMobile] Add 'Insert from URL' option to Image block (#40334) [RNMobile] Improvements to Getting Started Guides (#40964) Post Author Name: Add to and from Post Author transformations (#41151) CheckboxControl: Add unit tests (#41165) Improve inline documentation (#41209) Mobile Release v1.76.1 (#41196) Use explicit type definitions for entity configuration (#40995) Scripts: Convert file extension to js in `block.json` during build (#41068) Reflects revert in 6446878 (#41221) get_style_nodes should be compatible with parent method. (#41217) Gallery: Opt-in to axial (column/row) block spacing controls (#41175) Table of Contents block: convert line breaks to spaces in headings. (#41206) Add support for button elements to theme.json (#40260) Global Styles: Load block CSS conditionally (#41160) Update URL (#41188) Improve autocompleter performance (#41197) Site Editor: Set min-width for styles preview (#41198) Remove Navigation Editor screen from experiments page (#40878) Fix broken Page title for pages created inline within in Nav block (#41063) ...
Thanks @draganescu You're right on both counts: we don't need The intention behind this PR was to address the PHP warning
So we added Then the linter started complaining that So passing What do you think a valid path to deprecate the argument might be? I was thinking in a new PR we could:
Here's a PR that does all that: |
Hey, while working on #46579 I realized this PR was not backported to WordPress 6.1. When we land that PR and then backport to WordPress 6.2 everything will be fine, but I wanted to raise in case you think this should be ported for a potential WordPress 6.1.X release. |
It looks like the fact this PR wasn't backported is still causing some knock on effects. For example, #62465 needs to update the |
What?
Fix the following errors and fix phpdoc comment for get_styles_for_block.
Testing Instructions