Skip to content

Adds support for PHP8.5#43

Open
gavg-vaioni wants to merge 1 commit into
imanghafoori1:mainfrom
gavg-vaioni:PHP8.5
Open

Adds support for PHP8.5#43
gavg-vaioni wants to merge 1 commit into
imanghafoori1:mainfrom
gavg-vaioni:PHP8.5

Conversation

@gavg-vaioni

@gavg-vaioni gavg-vaioni commented Jul 2, 2026

Copy link
Copy Markdown

Adds support for PHP8.5

  • Updates Composer PHP Constraint

  • Updates ClassReferenceFinder to ignore "resource" ref, per stub, to fix failing test

Summary by Sourcery

Add support for running the library on PHP 8.5 by updating version constraints and aligning class reference handling with PHP 8.5 stubs.

New Features:

  • Support running the package on PHP 8.5.

Bug Fixes:

  • Ignore the "resource" class-like reference in ClassReferenceFinder to match PHP stub behavior and resolve a failing test.

Copilot AI review requested due to automatic review settings July 2, 2026 11:21
@sourcery-ai

sourcery-ai Bot commented Jul 2, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adds PHP 8.5 support by widening the Composer PHP version constraint and updating ClassReferenceFinder to treat "resource" as a non-class reference, aligning with PHP 8.5 stubs and fixing a failing test.

File-Level Changes

Change Details Files
Extend supported PHP versions to include PHP 8.5 via Composer configuration.
  • Expanded the Composer "php" require constraint to add support for 8.5.* alongside existing 7.2–8.4 versions.
  • Kept all other Composer requirements unchanged to minimize impact.
composer.json
Adjust class reference detection to ignore the "resource" type, aligning with updated stubs.
  • Added "resource" to the list of tokens/types that ClassReferenceFinder treats as non-class references.
  • Ensured this change fixes the previously failing test under PHP 8.5 without altering other behavior.
src/ClassReferenceFinder.php

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

@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 67e2f1d5-47fa-4e04-9d4e-2866471ca31f

📥 Commits

Reviewing files that changed from the base of the PR and between 5e5c2c4 and c0cd7ed.

📒 Files selected for processing (2)
  • composer.json
  • src/ClassReferenceFinder.php
👮 Files not reviewed due to content moderation or server errors (2)
  • composer.json
  • src/ClassReferenceFinder.php

📝 Walkthrough

[!WARNING]

Walkthrough skipped

File diffs could not be summarized.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@sourcery-ai sourcery-ai 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.

Hey - I've left some high level feedback:

  • Consider adding a short comment or reference next to the 'resource' entry explaining why it is treated as a reserved name (e.g., linking to the PHP 8.5 stubs or RFC), so future maintainers understand why it is special-cased.
  • The PHP version constraint list is becoming long and repetitive; consider simplifying it (e.g., using a range like ^8.0 or similar) if compatible with your support policy, to avoid needing to update this line on every minor PHP release.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider adding a short comment or reference next to the `'resource'` entry explaining why it is treated as a reserved name (e.g., linking to the PHP 8.5 stubs or RFC), so future maintainers understand why it is special-cased.
- The PHP version constraint list is becoming long and repetitive; consider simplifying it (e.g., using a range like `^8.0` or similar) if compatible with your support policy, to avoid needing to update this line on every minor PHP release.

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.

Copilot AI 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.

Pull request overview

This PR updates the package’s declared compatibility to include PHP 8.5 and aligns class reference detection with PHP 8.5 stub behavior by treating resource as a built-in (non-class) reference.

Changes:

  • Extend composer.json PHP requirement to allow 8.5.*.
  • Update ClassReferenceFinder::$ignoreRefs to ignore resource references.

Reviewed changes

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

File Description
src/ClassReferenceFinder.php Adds resource to the built-in/ignored reference list so it won’t be collected as a class-like reference.
composer.json Expands the PHP version constraint to include PHP 8.5.

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

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