Skip to content

feat: support PHP 8.3#93

Merged
valbeat merged 2 commits into
mainfrom
feat/php-8.3-support
Jul 7, 2026
Merged

feat: support PHP 8.3#93
valbeat merged 2 commits into
mainfrom
feat/php-8.3-support

Conversation

@valbeat

@valbeat valbeat commented Jul 7, 2026

Copy link
Copy Markdown
Owner

概要

コードレビューで指摘した「php: ^8.4 は必要以上に厳しい」への対応です。

このライブラリが使う最新の言語機能は readonly class(8.2)と #[Override](8.3)で、8.4 固有の機能は使用していません。要求を ^8.3 に緩めることで採用可能なプロジェクトの裾野が広がります。

変更内容

  • composer.json: php: ^8.4^8.3(dev 依存の phpunit 12.5 / php-cs-fixer 3.95 / phpstan は 8.3 対応済み)
  • phpstan.neon: phpVersion.min を 80300 に
  • CI 3 ワークフロー(test / phpstan / code-style)のマトリクスに 8.3 を追加
  • README の Requirements を更新

検証

  • PHPStan(level max, phpVersion: min 80300): エラーなし — 8.4 専用のシンボル・構文が使われていないことを解析レベルで確認
  • PHP 8.4 でのテスト: 69 tests パス(回 帰なし)
  • 実 PHP 8.3 でのテスト実行はこの PR で追加した CI マトリクスが担います(ローカルに 8.3 実行環境がないため)。マージ前に CI の 8.3 ジョブが green であることを確認してください。

https://claude.ai/code/session_017XTM7pxbWPVNLV639i5WgK

Summary by CodeRabbit

  • New Features
    • 対応する最小 PHP バージョンを 8.3 以上に拡大し、動作確認済みの範囲を 8.3 / 8.4 / 8.5 に更新しました。
  • Chores
    • CI の各種チェックを PHP 8.3, 8.4, 8.5 で実行するように調整しました。
    • キャッシュ設定を PHP バージョンごとに分け、ビルドの再利用性を改善しました。
  • Documentation
    • 必要環境の記載を最新の対応バージョンに合わせて更新しました。

The library uses nothing newer than readonly classes (8.2) and the
#[Override] attribute (8.3), so the ^8.4 platform requirement was
stricter than necessary and limited adoption.

- composer.json: php ^8.4 -> ^8.3
- phpstan.neon: phpVersion min 80400 -> 80300 (analysis passes with
  the 8.3 language/stdlib surface)
- CI: add 8.3 to the test, phpstan and code-style matrices
- README: update the requirements section

phpunit 12.5 and php-cs-fixer 3.95 both support PHP 8.3.

Claude-Session: https://claude.ai/code/session_017XTM7pxbWPVNLV639i5WgK
@valbeat valbeat self-assigned this Jul 7, 2026
@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

PHPの最小サポートバージョンを8.4から8.3へ引き下げる変更です。composer.json、phpstan.neon、.php-cs-fixer.dist.phpの設定を更新し、GitHub ActionsのCIワークフロー(code-style, phpstan, test)のPHPバージョンマトリクスに8.3を追加、Composerキャッシュキーをcomposer.jsonハッシュベースに変更、READMEのRequirements記載も更新しました。

Changes

PHP 8.3サポート拡張

Layer / File(s) Summary
言語要件とスタティック解析設定の更新
composer.json, phpstan.neon, .php-cs-fixer.dist.php
composerのphp要件を^8.4から^8.3に、phpstan.neonのphpVersion.minを80400から80300に、CSFixerのマイグレーションルールセットを@PHP84Migrationから@PHP83Migrationに変更。
CIワークフローのPHPマトリクスとキャッシュ更新
.github/workflows/code-style.yml, .github/workflows/phpstan.yml, .github/workflows/test.yml
3つのワークフローのPHPバージョンマトリクスに8.3を追加し、Composerキャッシュのkey/restore-keysをOS+PHPバージョン+composer.jsonハッシュでスコープするよう変更。
README要件記載の更新
README.md
Requirementsの最小PHPバージョンを8.4以上から8.3以上に変更し、テスト済みバージョン範囲を8.3, 8.4, 8.5に更新。

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • valbeat/php-result#79: 同様にCI(code-style.yml, phpstan.yml, test.yml)のPHPバージョンマトリクスとREADME/PHPStan設定の対応バージョンを拡張している点で密接に関連。

Poem

バージョン揃えて うさぎ跳ね
8.3も 仲間入り
キャッシュキーは composer.json
CIぐるぐる 緑の光
小さな変更 大きな安心🐇
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PRの主目的であるPHP 8.3対応を端的に示しており、変更内容とも一致しています。
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/php-8.3-support

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request lowers the minimum required PHP version from 8.4 to 8.3, updating the README, composer.json, and phpstan.neon configuration accordingly. There are no review comments, and I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (98a2fcb) to head (b3930b4).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff             @@
##                main       #93   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
  Complexity        40        40           
===========================================
  Files              2         2           
  Lines             80        80           
===========================================
  Hits              80        80           
Flag Coverage Δ
unittests 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

Code review of this PR found the 8.3 CI jobs red:

- .php-cs-fixer.dist.php used PHP 8.4-only parenthesless-new method
  chaining (new PhpCsFixer\Config()->setRules(...)), a hard parse
  error on PHP 8.3. Wrap in parentheses.
- Switch @PHP84Migration to @PHP83Migration so cs-fix can never
  rewrite code into 8.4-only forms while composer.json says ^8.3
  (no reformatting results from the switch today).
- Vendor cache keys hashed the gitignored composer.lock (always
  empty), so all matrix PHP versions shared one 'Linux-php-' cache.
  Key on the PHP version and composer.json hash instead.

Claude-Session: https://claude.ai/code/session_017XTM7pxbWPVNLV639i5WgK
@valbeat valbeat marked this pull request as ready for review July 7, 2026 04:35
Copilot AI review requested due to automatic review settings July 7, 2026 04:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

PHP の最小対応バージョンを 8.4 → 8.3 に緩和し、静的解析・CI・ドキュメントをそれに合わせて更新するPRです。ライブラリの利用可能範囲を広げつつ、CI で 8.3 の実行確認を担保する意図に沿った変更になっています。

Changes:

  • composer.json の PHP 要件を ^8.3 に変更
  • PHPStan の phpVersion.min80300 に更新
  • GitHub Actions の各ワークフローで PHP 8.3 をマトリクスに追加し、Composer vendor キャッシュキーを PHP バージョン別に分離
  • README の Requirements を更新

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
README.md 要求 PHP バージョン表記を 8.3+ に更新
phpstan.neon PHPStan の想定 PHP 最小バージョンを 8.3 に更新
composer.json require.php^8.3 に緩和
.php-cs-fixer.dist.php 移行ルールセットを @PHP83Migration に更新
.github/workflows/test.yml テストを PHP 8.3/8.4/8.5 で実行するように更新
.github/workflows/phpstan.yml PHPStan を PHP 8.3/8.4/8.5 で実行、キャッシュキーを PHP バージョン別に更新
.github/workflows/code-style.yml CS チェックを PHP 8.3/8.4/8.5 で実行、キャッシュキーを PHP バージョン別に更新

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -32,9 +32,9 @@ jobs:
uses: actions/cache@v3
@@ -28,9 +28,9 @@ jobs:
uses: actions/cache@v3
@valbeat valbeat merged commit cd92c8e into main Jul 7, 2026
13 checks passed
@valbeat valbeat deleted the feat/php-8.3-support branch July 7, 2026 06:34
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.

2 participants