Fix PHPCS/WPCS violations and add missing docblocks - #30
Open
miyanialkesh7 wants to merge 1 commit into
Open
Conversation
Auto-fix mechanical indentation/whitespace violations via phpcbf, add missing file/class/method docblocks, document two escaping false-positives with phpcs:ignore, prefix a local template variable, and exclude the classic WP file-naming sniffs since this plugin uses namespaced classes autoloaded via Composer's PSR-4.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
phpcbf— no logic changes.Plugin_Paths,Register_Blocks, andEnqueues, and to both blockrender.phptemplates.phpcs:ignorewith an explanatory comment on two false-positiveWordPress.Security.EscapeOutput.OutputNotEscapedfindings —get_block_wrapper_attributes()andwp_interactivity_data_wp_context()both already escape their own output; re-escaping would corrupt the HTML attributes they emit.$unique_idto$advanced_multi_block_unique_idintoggle/render.phpto satisfyWordPress.NamingConventions.PrefixAllGlobals.WordPress.Files.FileName.*sniffs inphpcs.xml.distwith a comment explaining why: this plugin intentionally uses namespaced classes autoloaded via Composer's PSR-4, so filenames match class names rather than the classicclass-{name}.phpconvention — enforcing that sniff would fight the plugin's own architecture.Result
composer run lint(phpcs): 127 errors / 59 warnings → 0 errors / 0 warningsTest Plan
php -lpasses on all 7 touched filescomposer run lintreports 0 errors, 0 warnings