Skip to content

Internal: Update PHPCS and fix all errors [TMZ-1049]#669

Merged
rami-elementor merged 3 commits into
mainfrom
phpcs
Jun 23, 2026
Merged

Internal: Update PHPCS and fix all errors [TMZ-1049]#669
rami-elementor merged 3 commits into
mainfrom
phpcs

Conversation

@rami-elementor

@rami-elementor rami-elementor commented Jun 22, 2026

Copy link
Copy Markdown
Member

Update wp-coding-standards/wpcs composer package from v2.3 to v3.3.0.

Remove unneeded exclude rules from phpcs.xml file.

Fix all remaining CS errors.

✨ PR Description

1. Problem & Context

Updated PHPCS to v3.3.0 and fixed all resulting violations. Modernized linting configuration to enforce stricter standards while removing overly permissive exclusions that masked issues.

2. What Changed (Where)

File Change
phpcs.xml Upgraded ruleset: stricter standards, removed 16 exclusions, added colorized output and extension filtering
comments.php, includes/script.php, settings-*.php, index.php, dynamic-footer.php Added translator comments, PHPCS ignore directives, fixed logical operator precedence
composer.json, package.json Bumped WPCS to 3.3.0, simplified lint scripts, added lint:php:report task
modules/admin-home/components/settings-controller.php Removed trailing blank line

3. How It Works

PHPCS v3.3.0 is stricter; the config now scans . explicitly with proper exclusions (assets/, tests/, vendor/, tmp/) instead of ignoring them inline. Code violations were fixed in-place: translator comment relocation (line positioning), proper parentheses grouping in conditionals, and PHPCS inline suppressions for intentional violations. Lint scripts now delegate to Composer runners from npm for single source of truth.

4. Risks

None significant. Changes are formatting/standards compliance only—no logic altered. Lint script simplification removes --extensions=php and ignore patterns from npm layer, relying on phpcs.xml (already present). Pre-commit hooks or CI must update command references if they call npm lint scripts directly.

Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using.
💡 Tip: You can customize your AI Description using Guidelines Learn how

@rami-elementor rami-elementor requested a review from hein-obox June 22, 2026 19:21
@rami-elementor rami-elementor changed the title Internal: Update PHPCS and fix all errors Internal: Update PHPCS and fix all errors [TMZ-1049] Jun 22, 2026
@rami-elementor rami-elementor merged commit ea47602 into main Jun 23, 2026
42 checks passed
@rami-elementor rami-elementor deleted the phpcs branch June 23, 2026 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants