Merged
Conversation
Member
ralflang
commented
Mar 2, 2026
- feat(cs-fixer): add custom fixers for PHP version comments and copyright years
- fix(qc): report correct total file count for PHP CS Fixer task
- feat(qc): add PHAR support for PHP CS Fixer custom fixers
- chore(build): include PHP CS Fixer config in PHAR build
- style: php-cs-fixer removes outdated 'PHP Version 7' comments
…ght years Add custom PHP CS Fixer rules to enforce Horde coding standards: 1. RemovePhpVersionCommentFixer - Removes "PHP Version X" lines from file-level and class-level docblocks 2. UpdateCopyrightYearFixer - Updates copyright years dynamically to include current year (e.g., "2025" → "2025-2026", "2020-2024" → "2020-2026") Updated .php-cs-fixer.dist.php configuration: - Exclude lib/ directory (legacy PSR-0 code) - Only format src/ and test/ directories with PER-1 style - Register custom fixers - Update to @PHP84Migration from deprecated @PHP83Migration Applied fixes to 101 files in src/ and test/ directories: - Removed all "PHP Version 7" comment lines - Updated copyright years to 2026 - Applied PER-1 coding style consistently All tests pass. No syntax errors introduced.
The Phpcsfixer QC task was incorrectly reporting only files that had issues, not the total number of files checked. This was misleading when all files were compliant. Changes: - Add getTotalFileCount() method that uses 'list-files' command - Set files_checked statistic before running fixer - Update parseResults() to only count files with issues - Files are now correctly counted (267 in components) Before: "8 files checked" (only files with changes) After: "267 files checked" (all files scanned by PHP CS Fixer)
When horde-components runs from a PHAR, custom PHP CS Fixer rules need to be extracted since PHP CS Fixer (external tool) cannot load classes from inside the PHAR. Changes: - Detect PHAR context using \Phar::running() - Extract .php-cs-fixer.dist.php and custom fixers to temp directory - Pass extracted config to PHP CS Fixer via --config option - Cleanup temp directory after execution and in destructor - Non-PHAR execution unchanged (uses default config discovery) This allows components to benefit from custom fixers (removing "PHP Version X" comments, updating copyright years) whether horde-components is run from source or PHAR.
Add .php-cs-fixer.dist.php to box.json files list so it's included in the PHAR archive. This is required for the Phpcsfixer QC task to extract and use custom fixers when running from PHAR.
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.