Skip to content

Modernize dev branch codebase to PHP 7.4+ minimum requirements#148

Open
zhyian wants to merge 9 commits intowecodemore:devfrom
zhyian:dev-modernization-php7.4-min
Open

Modernize dev branch codebase to PHP 7.4+ minimum requirements#148
zhyian wants to merge 9 commits intowecodemore:devfrom
zhyian:dev-modernization-php7.4-min

Conversation

@zhyian
Copy link

@zhyian zhyian commented Mar 18, 2026

Description

Mirrors the modernization done in version-3 (PR #142) for the dev branch. Raises the minimum PHP version to 7.4 and updates the codebase, tooling, and CI accordingly.

Codebase

  • Typed properties, union types, and null-safe operators across all src/ and tests/ files
  • Constructor promotion where applicable
  • Replace @var docblocks with native type declarations

Static analysis

  • Replace Psalm with PHPStan
  • Resolve all PHPStan errors including PHP 7.4-specific edge cases

CI / workflows

  • Split monolithic php-qa workflow into separate php-cs, php-lint, php-sa, and php-tests workflows
  • Drop blocked Composer 2.7.x and 2.8.x from CI matrix

How has this been tested?

  • All existing unit and integration tests pass
  • PHPStan static analysis passes at configured level 10
  • CI workflows validated against the matrix of supported PHP and Composer versions
  • Tested with projects on my local setup

Types of changes

What types of changes does your code introduce?

Bug fixes

  • Fix ENV_DIR config causing crash when not explicitly set: WpConfigStep, VcsIgnoreCheckStep, and EnvExampleStep used unwrap() which throws on the default null value. Changed to unwrapOrFallback('')(dbde344 and 5e40494).

New feature

  • N/A

Breaking change (fix or feature that break existing functionality)

  • Minimum PHP version raised from 7.1 to 7.4
  • Minimum Composer version raised to 2.3+ (drops v1 support)
  • Minimum PHPUnit version raised to 9.6+

Issues

Mirrors #142 for the dev branch.

Checklist:

  • My code is tested
  • My code follows the project code style
  • My code has documentation (for new features or changed behavior)

zhyian added 9 commits March 17, 2026 11:43
- Migrate to typed properties, constructor property promotion, and null-safe operators across all src/ and test files
- Replace Psalm with PHPStan for static analysis
- Split monolithic php-qa workflow into separate CS, lint, SA, and tests workflows
- Drop Composer v1 / RemoteFilesystem support (composer-plugin-api ^2.3)
- Drop PHPUnit cross-version compatibility shim (PHPUnit 9.6+ only)
@zhyian zhyian marked this pull request as ready for review March 18, 2026 14:39
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