Skip to content

fix: pass no object to invokeArgs() for static methods in ReflectionHelper - #10805

Merged
paulbalandan merged 1 commit into
codeigniter4:4.8from
paulbalandan:reflection-static-invoker
Nov 24, 2026
Merged

paulbalandan merged 1 commit into
codeigniter4:4.8from
paulbalandan:reflection-static-invoker

Conversation

@paulbalandan

Copy link
Copy Markdown
Member

Description
ReflectionHelper::getPrivateMethodInvoker() passes the object to ReflectionMethod::invokeArgs() even when the method is static. PHP 8.6 deprecates that, and the test environment turns the deprecation into an exception.

The invoker now passes null for static methods. Instance methods and class-string targets behave as before. The new test gets the invoker for a static method through an object, which raises the deprecation without the fix.

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value (without duplication)
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@carson-codeigniter4 carson-codeigniter4 Bot added 4.8 PRs that target the `4.8` branch. bug Verified issues on the current code behavior or pull requests that will fix them labels Nov 20, 2026
@paulbalandan
paulbalandan force-pushed the reflection-static-invoker branch from 50af761 to ac2b0f9 Compare November 23, 2026 16:58
Comment thread docs/changelogs/v4.8.0.md Resolved
@paulbalandan
paulbalandan force-pushed the reflection-static-invoker branch from ac2b0f9 to 9480f4a Compare November 24, 2026 11:42
@paulbalandan
paulbalandan merged commit de59b12 into codeigniter4:4.8 Nov 24, 2026
51 checks passed
@paulbalandan
paulbalandan deleted the reflection-static-invoker branch November 24, 2026 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4.8 PRs that target the `4.8` branch. bug Verified issues on the current code behavior or pull requests that will fix them

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants