Skip to content

Add PHP 8 compatibility and CI workflow#5

Merged
shannah merged 2 commits into
masterfrom
claude/php8-compatibility-plan-0uvbM
Apr 22, 2026
Merged

Add PHP 8 compatibility and CI workflow#5
shannah merged 2 commits into
masterfrom
claude/php8-compatibility-plan-0uvbM

Conversation

@shannah

@shannah shannah commented Apr 21, 2026

Copy link
Copy Markdown
Owner

Summary

This PR modernizes the HTML_QuickForm_depselect class for PHP 8 compatibility while maintaining backward compatibility with PHP 5.6+, and adds CI infrastructure.

Key Changes

  • PHP 8 Compatibility: Converted PHP 4-style constructor to __construct() method with fallback logic for older PEAR HTML_QuickForm versions that haven't been modernized
  • Constructor Compatibility: Added runtime check to use parent::__construct() when available, falling back to PHP 4-style parent constructor call for legacy installations
  • Code Cleanup: Fixed whitespace inconsistencies (trailing spaces, blank lines)
  • CI/CD Setup: Added GitHub Actions workflow to lint code against PHP 5.6, 7.4, 8.0, 8.1, 8.2, and 8.3
  • Project Configuration: Added composer.json with project metadata and dev dependencies for linting

Implementation 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

shannah and others added 2 commits April 20, 2026 21:18
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>
@shannah shannah force-pushed the claude/php8-compatibility-plan-0uvbM branch from 295bafa to 27f9641 Compare April 22, 2026 14:13
@shannah shannah merged commit 9bdf736 into master Apr 22, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant