Skip to content

feat: support PHP 8.1 - #98

Merged
roxblnfk merged 1 commit into
masterfrom
feat/php81
Nov 24, 2026
Merged

roxblnfk merged 1 commit into
masterfrom
feat/php81

Conversation

@roxblnfk

Copy link
Copy Markdown
Owner

🔍 What was changed

  • The plugin now installs and runs on PHP 8.1: require.php is >=8.1, and readonly classes in src/ became classes with readonly properties (Rector's PHP 8.1 downgrade sets).
  • tools/rector holds the downgrade config; composer rector and a new static-analysis job fail when syntax newer than PHP 8.1 slips into src/, bin/skills or the bundled skill's scripts.
  • The test matrix gains PHP 8.1: php-internal/actions/downgrade resolves 8.1-compatible dependencies and downgrades the rest (testo, its plugins) together with tests/ and testo.php.

Review notes

  • Rector's DowngradeStandaloneNullTrueFalseReturnTypeRector is skipped: it rewrites a valid T|false|null into T|bool|null and drops the precise docblock, which breaks psalm.
  • #[\Override] stays without a polyfill: the attribute is never instantiated through reflection, so PHP 8.1 and 8.2 ignore it.

Checklist

  • How was this tested:
    • Test suite run locally on PHP 8.4: 1740 passed, 33 skipped
    • psalm, cs:diff and rector --dry-run clean
    • Tested manually on PHP 8.1.31: all sources pass php -l; a throwaway project installs the plugin, skills:update syncs the bundled skill, skills:show and skills:validate exit 0
    • Test suite on PHP 8.1 (this PR's CI run)

ci: run the tests on PHP 8.1 and check the sources against Rector's PHP 8.1 downgrade sets

The plugin's only runtime dependency, internal/path, already runs on PHP 8.1; the 8.2 floor came from readonly classes alone. Rector's DowngradeStandaloneNullTrueFalseReturnTypeRector is skipped: it widens a valid `T|false|null` to `T|bool|null`. Constants of the ZipFixtures test trait move to a ZipMode class, since trait constants need PHP 8.2 and the downgrade sets leave them in place.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
@SerafimArts SerafimArts mentioned this pull request Nov 24, 2026
@roxblnfk
roxblnfk merged commit d157b51 into master Nov 24, 2026
19 of 20 checks passed
@roxblnfk
roxblnfk deleted the feat/php81 branch November 24, 2026 15:04
@roxblnfk roxblnfk linked an issue Nov 24, 2026 that may be closed by this pull request
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.

Add support PHP 8.1

1 participant