Add PHP 8 compatibility and CI workflow#5
Merged
Conversation
PHP 4-style constructors (method name matching class name) were deprecated in PHP 7 and removed in PHP 8. Rename to __construct() and call parent::__construct(). A runtime shim preserves compatibility with older xataface bundles whose PEAR HTML_QuickForm_input still exposes only the PHP 4 constructor. Also adds dev-only composer.json and a GitHub Actions lint matrix covering PHP 5.6 through 8.3.
PHPStan requires PHP 7.2+ but this project supports PHP 5.6+. Since PHPStan is not used in the CI workflow (only parallel-lint is run), removing it fixes the dependency resolution failure on PHP 5.6. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
295bafa to
27f9641
Compare
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
This PR modernizes the
HTML_QuickForm_depselectclass for PHP 8 compatibility while maintaining backward compatibility with PHP 5.6+, and adds CI infrastructure.Key Changes
__construct()method with fallback logic for older PEAR HTML_QuickForm versions that haven't been modernizedparent::__construct()when available, falling back to PHP 4-style parent constructor call for legacy installationscomposer.jsonwith project metadata and dev dependencies for lintingImplementation Details
The constructor change uses a conditional check at runtime to determine which parent constructor calling convention to use. This ensures the module works with both modernized PEAR bundles (PHP 8+) and legacy xataface installations that ship older, unmodified PEAR versions.
https://claude.ai/code/session_016DCo77UGqTpHnRw9RG6eGz