Skip to content

Add the PHPStan deprecation rules - #590

Merged
Art4 merged 1 commit into
v3.xfrom
582-phpstan-deprecation-rules
Nov 25, 2026
Merged

Art4 merged 1 commit into
v3.xfrom
582-phpstan-deprecation-rules

Conversation

@Art4

@Art4 Art4 commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

 composer.json
+    "phpstan/phpstan-deprecation-rules": "^2.0"

 .phpstan.neon
+includes:
+    - vendor/phpstan/phpstan-deprecation-rules/rules.neon

PHPStan now reports calls to deprecated functions, methods and classes (function.deprecated and friends). No deprecation surfaces in src/ and tests/ on level 6, so no production code changes. No changelog entry: dev tooling only.

Closes #582

Evidence

  • Before: a call to a @deprecated function passes composer run phpstan.
    After: the same call fails with Call to deprecated function Redmine\old582() (function.deprecated); the temporary file was removed again.
  • QA on PHP 8.2: PHPStan [OK] No errors, PHPUnit OK (848 tests, 4290 assertions), code style 0 files to fix, Rector dry run exit 0. Behat not run, no code changed.

Merge Danger

Door: two-way

Blast Radius: CI only. A new release of the extension can turn the PHPStan job red without a code change, like any other dev tool (composer.lock is not versioned).

Summary by CodeRabbit

  • Chores
    • Updated the project’s development checks. No changes to user-facing features or behavior.

@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change adds phpstan/phpstan-deprecation-rules as a development dependency and includes its rules in the PHPStan configuration.

Changes: PHPStan deprecation checks

Layer / File(s) Summary
Add and enable deprecation rules
.phpstan.neon, composer.json
Composer adds phpstan/phpstan-deprecation-rules with the ^2.0 constraint. The PHPStan configuration includes the package’s rules.

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

Change: Other

Suggested reviewers: kbsali

Merge Risk: Minimal · up to 92a4c

This adds deprecation checks to static analysis and changes no production code. The risk is minimal; a future extension update could surface new PHPStan failures in CI, but that is intended behavior.

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 "Add the PHPStan deprecation rules" matches the main change. The PR adds phpstan/phpstan-deprecation-rules as a dev dependency in composer.json and includes its rules.neon in .phpstan.neon, …
Linked Issues check Passed Issue #582 has three coding requirements: (1) add phpstan/phpstan-deprecation-rules as a dev dependency, (2) include its rules in .phpstan.neon, (3) fix any deprecations that surface, with no othe…
Out of Scope Changes check Passed The only changed files in the summary are composer.json and .phpstan.neon. Both directly implement issue #582 (dev dependency and PHPStan configuration). No production code under src/ or tests a…
Full details: Title check

Explanation

The title "Add the PHPStan deprecation rules" matches the main change. The PR adds phpstan/phpstan-deprecation-rules as a dev dependency in composer.json and includes its rules.neon in .phpstan.neon, so PHPStan flags deprecated API usage. The title is specific and short, and it names the primary change.

Full details: Linked Issues check

Explanation

Issue #582 has three coding requirements: (1) add phpstan/phpstan-deprecation-rules as a dev dependency, (2) include its rules in .phpstan.neon, (3) fix any deprecations that surface, with no other production-code change. The change summary shows composer.json gains "phpstan/phpstan-deprecation-rules": "^2.0" (+1/-0), and .phpstan.neon gains includes: with vendor/phpstan/phpstan-deprecation-rules/rules.neon (+3/-0). Requirement (3) is conditional. The author reports that no deprecations surface in src/ or tests/ at level 6, so no fixes are needed. The author also reports a before/after check: a call to a @deprecated function passed before the change and failed with function.deprecated after it. The author reports PHPStan [OK] No errors on PHP 8.2. The no-deprecation result rests on the author's run. It could not be re-executed with read-only tools, but it is consistent with the diff. The Housekeeping template line is explicitly not required by the issue.

Full details: Out of Scope Changes check

Explanation

The only changed files in the summary are composer.json and .phpstan.neon. Both directly implement issue #582 (dev dependency and PHPStan configuration). No production code under src/ or tests are changed, and the PR description states this. No unrelated changes are reported. The changelog is omitted, which the issue does not require. The PR's own QA results (PHPUnit, code style, Rector) are verification only and add no out-of-scope code.

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

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: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: bafb19a4-f85c-4be6-8d40-5dbfcc195d77
Commits

Reviewing files that changed from the base of the PR and between 0559319 and 92a4ce0.

Files selected for processing: 2

  • .phpstan.neon
  • composer.json

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

@codecov

codecov Bot commented Nov 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.26%. Comparing base (0559319) to head (92a4ce0).

Additional details and impacted files
@@            Coverage Diff            @@
##               v3.x     #590   +/-   ##
=========================================
  Coverage     99.26%   99.26%           
  Complexity      456      456           
=========================================
  Files            31       31           
  Lines          1505     1505           
=========================================
  Hits           1494     1494           
  Misses           11       11           

☔ 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.

@Art4
Art4 merged commit 8afaea3 into v3.x Nov 25, 2026
19 checks passed
@Art4
Art4 deleted the 582-phpstan-deprecation-rules branch November 25, 2026 05:23
@Art4 Art4 added this to the v3.1.0 milestone Nov 25, 2026
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 the PHPStan deprecation rules

1 participant