Skip to content

Conversation

@terabytesoftw
Copy link
Contributor

Q A
Is bugfix? ✔️
New feature?
Breaks BC?

@terabytesoftw terabytesoftw added the Estado: error Algo no funciona label Jan 22, 2026
@coderabbitai
Copy link

coderabbitai bot commented Jan 22, 2026

Warning

Rate limit exceeded

@terabytesoftw has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 7 minutes and 43 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between ce146fe and d746991.

📒 Files selected for processing (2)
  • CHANGELOG.md
  • tests/FoxyTest.php
📝 Walkthrough

Walkthrough

The PR modernizes PHP 8.5 compatibility by conditionally gating ReflectionProperty::setAccessible() calls to PHP versions below 8.5, updates CI workflow configuration and references, and documents associated bug fixes in the changelog.

Changes

Cohort / File(s) Summary
CI Workflow Configuration
.github/workflows/build.yml
Replaces explicit path-ignore lists with reusable anchor alias; normalizes double-quoted strings; updates phpunit workflow reference from php-forge/actions to yii2-framework/actions; removes explicit OS and PHP version matrix; adds top-level permissions block.
Changelog Documentation
CHANGELOG.md
Expands version 0.1.3 "Under development" section from a single Bug #112 entry to three entries (Bug #112 documentation updates, Bug #113 nullable type deprecation warnings, Bug #114 ReflectionProperty setAccessible deprecation).
PHP Version Compatibility
src/Util/ConsoleUtil.php, tests/FoxyTest.php
Introduces conditional ReflectionProperty::setAccessible() calls gated on PHP_VERSION_ID < 80500, preserving backward compatibility while adapting to PHP 8.5 deprecation of unconditional accessibility modifications. Imports PHP_VERSION_ID constant and applies version checks consistently across multiple test methods.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Poem

🐰 The workflow dances, configs align,
Eight-point-five compatibility shines,
No more unsafe accessibility calls,
Reflection adapts, the rabbit appalls—
Modern PHP, our tests now enthrall! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description check ✅ Passed The description indicates this is a bugfix without BC breaks, which aligns with the changeset focusing on conditional setAccessible() calls for PHP 8.5 compatibility.
Title check ✅ Passed The title directly and accurately describes the main objective of the changeset: fixing PHP 8.5 deprecation of setAccessible() in ReflectionProperty class, which is reflected across all modified files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


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.

@codecov
Copy link

codecov bot commented Jan 22, 2026

Codecov Report

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

Additional details and impacted files
@@             Coverage Diff             @@
##                main      #114   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
- Complexity       347       348    +1     
===========================================
  Files             26        26           
  Lines            802       803    +1     
===========================================
+ Hits             802       803    +1     

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

@terabytesoftw
Copy link
Contributor Author

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Jan 22, 2026

✅ Actions performed

Review triggered.

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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@CHANGELOG.md`:
- Line 17: Update the changelog entry text to include the missing preposition
"of": replace the line reading "Fix PHP `8.5` deprecation `setAccessible()` in
`ReflectionProperty` class" with "Fix PHP `8.5` deprecation of `setAccessible()`
in `ReflectionProperty` class" so the phrase is grammatically correct; locate
and edit the exact string in CHANGELOG.md.

In `@tests/FoxyTest.php`:
- Around line 150-152: Replace the fully-qualified constant usage
\PHP_VERSION_ID with the unqualified PHP_VERSION_ID for consistency across the
test (e.g., where it's used in the conditional around
assetFallbackProperty->setAccessible(true) and the other occurrences noted),
ensuring all checks use the imported PHP_VERSION_ID constant uniformly; update
the occurrences at the shown conditional and the similar block at 159-161 to the
unqualified form.
📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 406a412 and ce146fe.

📒 Files selected for processing (4)
  • .github/workflows/build.yml
  • CHANGELOG.md
  • src/Util/ConsoleUtil.php
  • tests/FoxyTest.php
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: terabytesoftw
Repo: php-forge/support PR: 11
File: tests/AssertTest.php:82-89
Timestamp: 2025-08-18T15:47:45.406Z
Learning: In PHP 8.1+, the RFC "Make Reflection setAccessible() a no-op" was implemented. This means ReflectionProperty and ReflectionMethod can access private and protected members automatically without requiring setAccessible(true) calls. The setAccessible() method still exists for backward compatibility but has no effect.
Learnt from: terabytesoftw
Repo: php-forge/support PR: 12
File: src/TestSupport.php:0-0
Timestamp: 2025-08-18T20:13:33.518Z
Learning: User terabytesoftw prefers clean trait-based designs over maintaining backward compatibility wrappers when refactoring utility classes in the php-forge/support project.
Learnt from: terabytesoftw
Repo: php-forge/actions PR: 65
File: .github/workflows/composer-require-checker.yml:80-83
Timestamp: 2025-09-28T15:12:48.345Z
Learning: The user terabytesoftw prefers using floating tags like v1 for third-party actions in GitHub workflows instead of pinning to specific commit SHAs, even when it's a security best practice to pin to immutable commits.
📚 Learning: 2025-08-18T15:47:45.406Z
Learnt from: terabytesoftw
Repo: php-forge/support PR: 11
File: tests/AssertTest.php:82-89
Timestamp: 2025-08-18T15:47:45.406Z
Learning: In PHP 8.1+, the RFC "Make Reflection setAccessible() a no-op" was implemented. This means ReflectionProperty and ReflectionMethod can access private and protected members automatically without requiring setAccessible(true) calls. The setAccessible() method still exists for backward compatibility but has no effect.

Applied to files:

  • src/Util/ConsoleUtil.php
  • tests/FoxyTest.php
📚 Learning: 2026-01-22T11:42:32.878Z
Learnt from: terabytesoftw
Repo: php-forge/foxy PR: 111
File: tests/Fallback/AssetFallbackTest.php:98-98
Timestamp: 2026-01-22T11:42:32.878Z
Learning: When using xepozz/internal-mocker in PHP tests, the library's namespaced wrapper records and matches function calls with all default parameters filled in. To ensure proper matching, always specify every parameter in MockerState::addCondition(), including defaults. For example, a call to file_get_contents($path) is observed as file_get_contents($path, false, null, 0, null). Use the same complete argument list (including default values) when adding conditions for mocks in tests like tests/Fallback/AssetFallbackTest.php.

Applied to files:

  • tests/FoxyTest.php
🔇 Additional comments (6)
src/Util/ConsoleUtil.php (1)

21-22: LGTM! Clean implementation of the PHP 8.5 deprecation fix.

The version-gated setAccessible() call correctly avoids the deprecation warning in PHP 8.5+ while maintaining backward compatibility. Based on learnings, since PHP 8.1+ setAccessible() is a no-op anyway, so the functional behavior is preserved across all supported versions.

Also applies to: 41-45

.github/workflows/build.yml (3)

15-16: Good addition of explicit permissions.

Adding permissions: contents: read follows the principle of least privilege for GitHub Actions workflows, reducing the attack surface.


3-11: Clean refactor using YAML anchors.

The use of YAML anchor (&ignore-paths) and alias (*ignore-paths) eliminates duplication between pull_request and push triggers effectively.


20-20: Change phpunit workflow reference to use php-forge/actions for consistency.

The phpunit workflow references yii2-framework/actions, but the other workflows in this repository (dependency-check.yml and ecs.yml) both use php-forge/actions. This should be uses: php-forge/actions/.github/workflows/phpunit.yml@main to maintain consistency with the repository's action references.

Likely an incorrect or invalid review comment.

tests/FoxyTest.php (2)

31-32: LGTM! Correct import for PHP_VERSION_ID constant.


182-206: LGTM! Version-gated setAccessible() calls are correctly implemented.

The conditional checks properly guard against calling the deprecated setAccessible() method on PHP 8.5+, maintaining backward compatibility for older versions.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

@terabytesoftw terabytesoftw changed the title fix(foxy): Fix PHP 8.5 deprecation setAccessible() in ReflectionProperty class. fix(foxy): Fix PHP 8.5 deprecation of setAccessible() in ReflectionProperty class. Jan 22, 2026
@terabytesoftw terabytesoftw merged commit 434f22d into main Jan 22, 2026
28 checks passed
@terabytesoftw terabytesoftw deleted the fix_mini_8 branch January 22, 2026 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Estado: error Algo no funciona

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants