Skip to content

Conversation

@koriym
Copy link
Member

@koriym koriym commented Nov 11, 2025

Summary

  • Remove deprecated Doctrine annotations (@annotation, @qualifier, @\Ray\Di\Di\Inject) in favor of PHP 8 attributes
  • Update dependencies for PHP 8.0+ compatibility
  • Modernize PHPUnit configuration

Changes

  • Remove Doctrine annotations from annotation classes (Cookie, DeleteCookie, AuraSessionInject)
  • Update copyright year to 2025
  • Update PHP requirement to ^8.0
  • Update ray/di minimum version to ^2.14 for PHP 8.0 compatibility
  • Update PHPUnit to 9.6 (compatible with PHP 8.0+)
  • Migrate phpunit.xml to PHPUnit 9.6 format
  • Update CI workflow to test PHP 8.0-8.5
  • Add PHPUnit cache files to .gitignore

Test Plan

  • All unit tests pass
  • Tests pass with --prefer-lowest dependencies
  • CI tests confirmed passing

Summary by Sourcery

Remove legacy Doctrine annotations in favor of native PHP 8 attributes, bump PHP requirements and dependencies for PHP 8 compatibility, and modernize the testing and CI configuration.

Enhancements:

  • Replace deprecated Doctrine annotations with PHP 8 attributes in Cookie, DeleteCookie and session injection trait
  • Raise minimum PHP version to ^8.0 and bump ray/di dependency to ^2.14

Build:

  • Update composer.json to require PHP 8.0+, ray/di ^2.14 and PHPUnit ^9.6

CI:

  • Adjust CI workflow to test only on PHP 8.0–8.5

Tests:

  • Upgrade to PHPUnit 9.6, migrate phpunit.xml to its format and ignore PHPUnit cache files

Chores:

  • Update license year to 2025

Summary by CodeRabbit

  • Chores

    • Updated CI/CD workflow to support PHP 8.0–8.5
    • Increased PHP minimum requirement to 8.0 (dropped 7.x support)
    • Updated PHPUnit to version 9.6 with enhanced configuration flags
    • Updated Ray.Di dependency to version 2.14
    • Refreshed test configuration and build files
    • Updated copyright year to 2025
  • Refactor

    • Modernized annotation syntax to PHP 8 attribute syntax

@sourcery-ai
Copy link

sourcery-ai bot commented Nov 11, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR migrates from Doctrine annotations to PHP 8 attributes, upgrades core dependencies for PHP 8 compatibility, and modernizes testing and CI configurations.

Class diagram for updated annotation classes using PHP 8 attributes

classDiagram
class Cookie {
  <<final>>
  +__construct()
}
class DeleteCookie {
  <<final>>
  +__construct()
}
class Qualifier
Cookie --|> Qualifier
DeleteCookie --|> Qualifier
Cookie : <<Attribute>>
DeleteCookie : <<Attribute>>
Loading

Class diagram for AuraSessionInject trait after annotation removal

classDiagram
class AuraSessionInject {
  -Session session
  +setSession(Session session)
}
class Session
AuraSessionInject --> Session
Loading

File-Level Changes

Change Details Files
Replaced Doctrine annotations with PHP 8 attributes src/Annotation/Cookie.php
src/Annotation/DeleteCookie.php
src/AuraSessionInject.php
Bumped PHP and package requirements
  • Set PHP requirement to ^8.0
  • Updated ray/di minimum version to ^2.14
  • Upgraded PHPUnit to ^9.6
composer.json
Modernized PHPUnit configuration
  • Migrated phpunit.xml.dist to PHPUnit 9.6 format
  • Added PHPUnit cache files to .gitignore
phpunit.xml.dist
.gitignore
Adjusted CI PHP version matrix
  • Updated old_stable matrix to PHP 8.0–8.4
  • Set current_stable version to PHP 8.5
.github/workflows/continuous-integration.yml
Updated license year
  • Bumped copyright year to 2025
LICENSE

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@codecov
Copy link

codecov bot commented Nov 11, 2025

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@coderabbitai
Copy link

coderabbitai bot commented Nov 11, 2025

Walkthrough

The PR modernizes the codebase for PHP 8+ by replacing Doctrine-style PHPDoc annotations with native PHP 8 attributes in annotation classes, updating minimum PHP requirement from 7.2 to 8.0, bumping dependencies (Ray.Di, PHPUnit), and updating CI/test configuration to PHPUnit 9.6 standards.

Changes

Cohort / File(s) Summary
CI & Configuration
.github/workflows/continuous-integration.yml, phpunit.xml.dist, composer.json
Updated CI workflow to test PHP 8.0–8.4; upgraded PHPUnit configuration to schema 9.6 with strict checking flags and coverage settings; dropped PHP 7.x support (^7.2 → ^8.0), removed legacy keywords, bumped Ray.Di (^2.5.3 → ^2.14) and PHPUnit (^8.5.29 || ^9 → ^9.6)
Project Metadata
.gitignore, LICENSE
Added PHPUnit cache files to .gitignore; updated copyright year to 2025
Annotation Modernization
src/Annotation/Cookie.php, src/Annotation/DeleteCookie.php
Removed PHPDoc-based @Annotation and @Qualifier docblocks; retained PHP 8 native attribute syntax (#[Attribute, Qualifier])
Dependency Injection
src/AuraSessionInject.php
Removed @Inject PHPDoc annotation from setSession() method

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Annotation migration pattern: Straightforward docblock-to-attribute conversions across multiple files; verify consistency in approach
  • Dependency updates: Ray.Di major-version bump (2.5.3 → 2.14); confirm compatibility with codebase changes
  • PHPUnit configuration: New strict checking flags and coverage configuration; validate that all flags align with test requirements and don't inadvertently break existing tests
  • PHP version constraint change: Dropping 7.x support; ensure no legacy code paths remain

Possibly related issues

Poem

🐰 Old docblocks fade, PHP 8 takes the stage,
Attributes dance, marking a modern age,
Farewell to seven, eight leads the way,
Cache files hidden, tests run cleaner today!
Hop forward, we bound, to futures more bright—
Ray.Di's renewed, shining ever more bright!

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and concisely summarizes the main change: removing Doctrine annotations in favor of PHP 8 attributes, which is reflected across multiple modified files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch remove-doctrine-annotations

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c60ede3 and 2153150.

📒 Files selected for processing (8)
  • .github/workflows/continuous-integration.yml (1 hunks)
  • .gitignore (1 hunks)
  • LICENSE (1 hunks)
  • composer.json (1 hunks)
  • phpunit.xml.dist (1 hunks)
  • src/Annotation/Cookie.php (0 hunks)
  • src/Annotation/DeleteCookie.php (0 hunks)
  • src/AuraSessionInject.php (0 hunks)
💤 Files with no reviewable changes (3)
  • src/Annotation/DeleteCookie.php
  • src/AuraSessionInject.php
  • src/Annotation/Cookie.php
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: ci / PHPUnit - PHP 8.5 (windows-latest, highest)
  • GitHub Check: Sourcery review
🔇 Additional comments (6)
.gitignore (1)

14-15: LGTM!

Adding PHPUnit cache files to .gitignore is appropriate for the PHPUnit 9.6 upgrade. These cache files are generated at runtime and should not be tracked in version control.

LICENSE (1)

3-3: LGTM!

Standard copyright year update for the new year.

composer.json (2)

8-9: LGTM!

The dependency updates correctly reflect the PHP 8+ migration:

  • PHP requirement now enforces ^8.0 minimum
  • ray/di bumped to ^2.14 for PHP 8 attribute support

These breaking changes are appropriate for the 1.x branch and align with the PR's objective to modernize the codebase.


14-14: LGTM!

PHPUnit upgrade to ^9.6 is consistent with the phpunit.xml.dist migration to PHPUnit 9.6 schema and configuration format.

.github/workflows/continuous-integration.yml (1)

12-13: LGTM!

The CI matrix correctly reflects the new PHP version support:

  • Dropped PHP 7.x versions (7.2, 7.3, 7.4) consistent with the composer.json requirement
  • Added PHP 8.4 to the test matrix
  • Updated current stable to 8.5

The CI configuration properly validates the codebase against the supported PHP 8.0–8.5 range.

phpunit.xml.dist (1)

2-21: LGTM!

The PHPUnit configuration has been properly migrated to the 9.6 format:

  • Schema correctly references PHPUnit 9.6 XSD
  • Cache result file location (line 5) aligns with the .gitignore additions
  • Strict test settings (beStrictAbout*, failOn*) enforce better test quality
  • Coverage configuration properly includes the src directory
  • All configuration options follow PHPUnit 9.6 best practices

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 and usage tips.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes - here's some feedback:

  • Consider specifying attribute targets on your PHP 8 attributes (e.g. Attribute::TARGET_CLASS or TARGET_METHOD) to match the original Doctrine annotation usage and prevent unintended placements.
  • Update any usage examples or README content that reference Doctrine annotations so they illustrate the new PHP 8 attribute syntax and guide users through the migration.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider specifying attribute targets on your PHP 8 attributes (e.g. Attribute::TARGET_CLASS or TARGET_METHOD) to match the original Doctrine annotation usage and prevent unintended placements.
- Update any usage examples or README content that reference Doctrine annotations so they illustrate the new PHP 8 attribute syntax and guide users through the migration.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@koriym koriym merged commit 24258a0 into 1.x Nov 11, 2025
31 of 32 checks passed
@koriym koriym deleted the remove-doctrine-annotations branch November 11, 2025 16:14
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