Skip to content

Move static analysis to the shared v1 workflow and update tooling - #40

Merged
koriym merged 4 commits into
1.xfrom
modernize-ci-tooling
Nov 23, 2026
Merged

koriym merged 4 commits into
1.xfrom
modernize-ci-tooling

Conversation

@koriym

@koriym koriym commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Static Analysis called ray-di/.github static-analysis.yml@v2 (a stale 2024 branch: PHP fixed at 8.3, no php_version input). It now calls @v1 with php_version: 8.4 and has_crc_config: true (composer-require-checker.json is kept). Coding Standards was already on @v1 (8.4); Continuous Integration is a local workflow because the tests need Redis and Memcached services.
  • CI: drop the operating-system matrix axis. The job always ran on ubuntu-latest, so the Windows entries were duplicate Ubuntu runs (20 jobs → 10). Matrix stays PHP 8.2–8.6 × lowest/highest. actions/checkout and codecov/codecov-action move to v5.
  • Tools (vendor-bin): psalm 5 → 6, phpstan 1 → 2, PHP_CodeSniffer 3 → 4, doctrine/coding-standard 11 → 14, phpmd 2 → 3. The unused psalm/plugin-phpunit is removed.
    • phpcs php_version now matches the 8.2 floor (it said 7.3). phpcbf reformatted src (T|null, trailing commas); this does not change behavior.
    • psalm 6 reports ClassMustBeFinal for the adapters, providers and exceptions. Making them final would stop users from extending them, so they are marked @psalm-api instead (Doctrine CS forbids @api). ensureOverrideAttribute is off because #[Override] needs PHP 8.3.
  • PHPUnit stays on 11 (12 requires PHP 8.3). The @depends doc-comments become #[Depends]. The always-true assertIsString checks become class-name assertions. FakeFoo is now bound explicitly, which clears Ray.Di's JIT-binding deprecation. The empty <coverage> element is removed. The suite runs with no deprecations.
  • Housekeeping: remove .scrutinizer.yml (not used) and the dead setup script (bin/setup.php does not exist). The sa script now runs the vendor psalm and phpmd. .gitattributes keeps tests, CI, tool and agent files out of the dist archive. README drops the PHP 7.4 doc-comment example.

Local checks (PHP 8.4)

phpunit (23 tests, Redis/Memcached running), phpcs, phpstan, psalm, phpmd and composer-require-checker 4.24 all pass. On PHP 8.2, phpunit passes with both lowest and highest dependencies.

Summary by CodeRabbit

  • Chores
    • Updated the project’s development and analysis tools, and refreshed continuous-integration checks.
    • Updated PHP code-style checks to target PHP 8.2.
  • Tests
    • Updated test dependency declarations and serialization checks to work with current PHPUnit conventions.

- static-analysis.yml now calls ray-di/.github static-analysis.yml@v1 with php_version 8.4 and has_crc_config.
- Drop the unused operating-system matrix axis: the job always ran on ubuntu-latest (the Redis/Memcached services need Linux), so every Windows entry duplicated an Ubuntu run.
- Bump actions/checkout to v5 and codecov/codecov-action to v5 (files input).
- psalm 5 -> 6, phpstan 1 -> 2, PHP_CodeSniffer 3 -> 4, doctrine/coding-standard 11 -> 14, phpmd 2 -> 3; drop the unused psalm/plugin-phpunit.
- phpcs php_version follows the PHP 8.2 floor; src is reformatted by phpcbf (T|null, trailing commas, no behavior change).
- Mark the extendable adapters, providers and exceptions @psalm-api instead of making them final, which would break extending them.
- psalm: ensureOverrideAttribute off because #[Override] needs PHP 8.3; schema path points to vendor-bin.
- composer: remove the setup script for the missing bin/setup.php; sa runs the vendor psalm and phpmd.
- @Depends doc-comments become #[Depends] (doc-comment metadata is removed in PHPUnit 12).
- Serialization tests assert the class name in the payload instead of the always-true assertIsString.
- Bind FakeFoo explicitly: Ray.Di deprecates just-in-time binding of unbound concrete classes.
- Remove the empty <coverage> element.
- .gitattributes export-ignores the CI, test, tool and agent files (tests-pecl-ext, tests-php8, src-files, vendor-bin, .github, CLAUDE.md, psalm.xml, composer-require-checker.json) and drops entries for files that no longer exist.
- Remove .scrutinizer.yml: Scrutinizer is not used (no badge, no workflow).
- README: remove the PHP 7.4 doc-comment example; the package requires PHP 8.2 and attributes only.
@codecov

codecov Bot commented Nov 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (0b0aabc) to head (40aad51).

Additional details and impacted files
@@             Coverage Diff             @@
##                 1.x       #40   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
  Complexity        38        38           
===========================================
  Files             24        24           
  Lines             90        90           
===========================================
  Hits              90        90           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@koriym

koriym commented Nov 23, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor
Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The pull request updates development tools, analysis and CI configuration, source annotations and nullable parameter notation, and PHPUnit tests. It also changes archive exclusions and removes PHP-version examples from the README.

Changes: Toolchain and compatibility updates

Layer / File(s) Summary
Tooling, configuration, and CI
.github/workflows/*, .gitattributes, .scrutinizer.yml, README.md, composer.json, phpcs.xml, phpunit.xml.dist, psalm.xml, vendor-bin/tools/composer.json
Development-tool constraints and analysis settings changed. CI removes the operating-system matrix and updates action versions and inputs. The archive exclusions and README examples changed, and the empty PHPUnit coverage block was removed.
Source annotations and nullable type notation
src/*.php, src/Exception/*
Several classes gained @psalm-api annotations. Nullable constructor parameters now use explicit union notation instead of nullable shorthand; defaults and constructor behavior remain unchanged.
PHPUnit test updates
tests/*AdapterTest.php, tests-pecl-ext/*, tests-php8/*
Tests replace dependency docblocks with PHPUnit Depends attributes. Serialization assertions and one test’s module setup also changed.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Other

Suggested reviewers: naokitsuchiya

Merge Risk: Minimal · up to 40aad · assessed changes only

Path filters excluded changed files. This rating applies only to the assessed changes.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "Move static analysis to the shared v1 workflow and update tooling" matches the main changes. The static-analysis workflow now uses ray-di/.github static-analysis.yml@v1 with PHP 8.4. The ve…
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.
Full details: Title check

Explanation

The title "Move static analysis to the shared v1 workflow and update tooling" matches the main changes. The static-analysis workflow now uses ray-di/.github static-analysis.yml@v1 with PHP 8.4. The vendor-bin tool constraints were upgraded (Psalm 6, PHPStan 2, PHP_CodeSniffer 4, Doctrine Coding Standard 14, PHPMD 3). The title is specific and concise. It omits the broader CI matrix, PHPUnit test, and package-archive changes, which is acceptable.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

PHPStan (2.3.5)

Composer install failed because a package host returned a transient server or timeout response. The host may recover on a later review.

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Central YAML; Path: .coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 82a0bbd0-2a6f-4ae6-bb26-48eaff4f8909
Commits

Reviewing files that changed from the base of the PR and between 0b0aabc and 40aad51.

Files ignored due to path filters: 2

  • vendor-bin/metrics/composer.lock is excluded by !**/*.lock
  • vendor-bin/tools/composer.lock is excluded by !**/*.lock
Files selected for processing: 31

  • .gitattributes
  • .github/workflows/continuous-integration.yml
  • .github/workflows/static-analysis.yml
  • .scrutinizer.yml
  • README.md
  • composer.json
  • phpcs.xml
  • phpunit.xml.dist
  • psalm.xml
  • src/ApcuAdapter.php
  • src/CacheDirModule.php
  • src/CacheNamespaceModule.php
  • src/Exception/LogicException.php
  • src/Exception/RedisConnectionException.php
  • src/Exception/RuntimeException.php
  • src/FilesystemAdapter.php
  • src/MemcachedAdapter.php
  • src/MemcachedProvider.php
  • src/PhpFileAdapter.php
  • src/Psr6MemcachedModule.php
  • src/Psr6RedisModule.php
  • src/RedisAdapter.php
  • src/RedisProvider.php
  • tests-pecl-ext/Psr6MemcacheModuleTest.php
  • tests-php8/Php8PsrCacheTest.php
  • tests/ApcuAdapterTest.php
  • tests/FilesystemAdapterTest.php
  • tests/MemcachedAdapterTest.php
  • tests/PhpFileAdapterTest.php
  • tests/RedisAdapterTest.php
  • vendor-bin/tools/composer.json
Files with no reviewable changes: 3

  • .scrutinizer.yml
  • README.md
  • phpunit.xml.dist

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@koriym
koriym merged commit 5bb37a6 into 1.x Nov 23, 2026
33 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