Skip to content

fix: handle nullable ArrayDataProvider::$allModels and align Controller::actions() stub types with Yii 22.0 for PHPStan. - #174

Merged
terabytesoftw merged 2 commits into
mainfrom
fix/phpstan-yii22-types
Nov 26, 2026
Merged

terabytesoftw merged 2 commits into
mainfrom
fix/phpstan-yii22-types

Conversation

@terabytesoftw

Copy link
Copy Markdown
Member

Pull Request

  • Breaking change (fix or feature that would cause existing functionality to change)
  • Bugfix (non-breaking change that fixes an issue)
  • CI/build configuration
  • Dependency update
  • Documentation update
  • New feature (non-breaking change that adds functionality)
  • Performance improvement
  • Refactoring (no functional changes)
  • Tests

Change

Explain the problem and the resulting behavior. Include a before/after example when useful.

Validation

List the checks performed and their results. Explain any relevant checks not run.

Compatibility

Describe any behavior, configuration, dependency, or migration impact. Write "None" when there is no compatibility
impact.

Related issues

Link relevant issues. Use closing keywords only when this PR fully resolves them.

…oller::actions()` stub types with Yii `22.0` for PHPStan.
@terabytesoftw terabytesoftw added the bug Something isn't working label Nov 26, 2026
@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Explain Change →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 53 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 23bfb0fe-bc20-4ec6-863a-fb6afd1f507c
Commits

Reviewing files that changed from the base of the PR and between 87655ef and 571498f.

Files selected for processing: 1

  • composer.json

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Bug Fixes
    • Profiling details now handle cases where model data is unavailable without passing a null value to filtering.
  • Tests
    • Added checks that search results contain model data before inspecting them.
  • Documentation
    • Updated the development changelog and controller action type documentation for compatibility with current Yii type definitions.

The profiling panel now handles a null allModels value by using an empty array. Database search tests assert that allModels is an array. The controller action stub documentation now allows an optional class or __class key.

Changes: Profiling provider handling

Layer / File(s) Summary
Nullable provider handling and checks
src/panels/ProfilingPanel.php, tests/db/DbSearchTest.php, CHANGELOG.md
ProfilingPanel::getDetail() passes an empty array to filteredRows() when allModels is null. The database search tests assert that allModels is an array. The changelog records these changes and the action stub type update.

Controller action stub shape

Layer / File(s) Summary
Action configuration shape
tests/support/stub/router/controllers/BadController.php
The actions() PHPDoc shape allows each action configuration to omit class and include optional __class.

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

Change: Bug fix

Merge Risk: Minimal · previous review 87655

This change makes the profiling panel handle a missing model list safely and brings the controller action stub's documented types into line with Yii 22.0. Behavior is unchanged when data is present, and the remaining changes are tests and documentation. Merge-readiness risk is minimal.

Pre-merge checks: Passed 3 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Description check Inconclusive The description contains only the unfilled PR template: a checked Bugfix box and template headings for Change, Validation, Compatibility, and Related issues. It does not describe the changeset. The ch… Replace the template placeholder text under Change with a short description of the nullable ArrayDataProvider::$allModels fix in ProfilingPanel::getDetail() and the actions() stub type alignment. Add validation steps (such as the PHPStan ru…
Passed Passed checks: 3 passed

Check name Status Explanation
Title check Passed The title names both changes in the changeset: handling nullable ArrayDataProvider::$allModels (ProfilingPanel::getDetail() now passes an empty array when allModels is null) and aligning Controller::a…
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 names both changes in the changeset: handling nullable ArrayDataProvider::$allModels (ProfilingPanel::getDetail() now passes an empty array when allModels is null) and aligning Controller::actions() stub types with Yii 22.0 for PHPStan (BadController.php return-type documentation). It is specific and matches the changes, though it is long at 126 characters.

Full details: Description check

Explanation

The description contains only the unfilled PR template: a checked Bugfix box and template headings for Change, Validation, Compatibility, and Related issues. It does not describe the changeset. The checked Bugfix type is related to the change, but the lenient check needs some connection to the changeset, and the template text carries no specific information about it.

Resolution

Replace the template placeholder text under Change with a short description of the nullable ArrayDataProvider::$allModels fix in ProfilingPanel::getDetail() and the actions() stub type alignment. Add validation steps (such as the PHPStan run and the updated DbSearchTest assertions) and state any compatibility impact.

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

A rabbit checks the rows at night,
An empty list makes nulls all right.
The tests confirm the models’ shape,
The stub now lets __class escape.
I twitch my nose and hop away,
While changelog notes the work today.

@codecov

codecov Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (ed3157d) to head (571498f).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff             @@
##                main      #174   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
  Complexity      1298      1298           
===========================================
  Files            101       101           
  Lines           4832      4832           
===========================================
  Hits            4832      4832           

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

@terabytesoftw
terabytesoftw merged commit 91624d5 into main Nov 26, 2026
45 of 46 checks passed
@terabytesoftw
terabytesoftw deleted the fix/phpstan-yii22-types branch November 26, 2026 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant