Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors several conditional checks to improve readability across the theme builder and Hyvä scanning logic, and aligns local PHPCS rules with the plain upstream Magento2 standard to avoid mismatches with external package checkers.
Changes:
- Simplifies theme builder
detect()conditionals by extracting composer package name checks into a single variable. - Refactors Hyvä compatibility detection to use an intermediate boolean for clearer intent.
- Updates
phpcs.xml.distto run the fullMagento2standard with no local exclusions and documents the formatter/PHPCS implication for multi-line conditions.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/Service/ThemeBuilder/TailwindCSS/Builder.php | Simplifies composer.json package-name conditional in detect() for non-Hyvä Tailwind themes. |
| src/Service/ThemeBuilder/HyvaThemes/Builder.php | Simplifies composer.json package-name conditional in detect() for Hyvä themes. |
| src/Service/Hyva/ModuleScanner.php | Extracts Hyvä compatibility package detection into a named boolean for readability. |
| src/Console/Command/System/CheckCommand.php | Extracts the “is LTS release” check into a boolean to simplify the foreach condition. |
| phpcs.xml.dist | Removes the local exclusion and documents why conditions should be kept single-line (via extracted sub-expressions). |
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.
This pull request introduces several code simplifications and refactorings to improve readability and maintainability, as well as an update to the PHP CodeSniffer configuration for stricter code style enforcement. The main changes include extracting boolean expressions into variables for clarity, updating the code style rules to match external package checkers, and simplifying logic for composer package detection.
Code Simplification and Refactoring:
getLatestLtsNodeVersion,isHyvaCompatibilityPackage, and theme builder detection methods. This makes the code easier to read and debug. [1] [2] [3] [4]Code Style and Standards:
phpcs.xml.distto enforce the full Magento2 coding standard without local exclusions. This ensures that the codebase adheres to the same standards as external package checkers, preventing hidden issues. The comment now recommends extracting sub-expressions into variables to avoid multi-line condition conflicts.