Skip to content

Fix unsetMethod handling for camelCase methods#1780

Open
Dayoebe wants to merge 6 commits into
barryvdh:masterfrom
Dayoebe:master
Open

Fix unsetMethod handling for camelCase methods#1780
Dayoebe wants to merge 6 commits into
barryvdh:masterfrom
Dayoebe:master

Conversation

@Dayoebe

@Dayoebe Dayoebe commented Apr 26, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR fixes unsetMethod() so it can correctly remove generated methods regardless of the casing used when calling it.

Currently, setMethod() stores method names using their original casing, while unsetMethod() tries to remove the lowercase version of the method name. Because of this, calling unsetMethod('newModelQuery') does not remove the generated newModelQuery method.

This update makes unsetMethod() compare method names case-insensitively while still unsetting the actual stored key.

Fixes #1381.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • Existing tests have been adapted and/or new tests have been added
  • Update the README.md
  • Code style has been fixed via composer fix-style

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.

Method with same name already defined in this class

1 participant