Skip to content

[13.x] Enforce static calls#59704

Merged
taylorotwell merged 2 commits into
laravel:13.xfrom
lucasmichot:13.x-static-calls
Apr 15, 2026
Merged

[13.x] Enforce static calls#59704
taylorotwell merged 2 commits into
laravel:13.xfrom
lucasmichot:13.x-static-calls

Conversation

@lucasmichot

@lucasmichot lucasmichot commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

Replaces instance-syntax calls ($obj->method()) with static call syntax ($obj::method() / self::method()) wherever the called method is declared static, across src/, tests/, and types/.

Calling a static method via $this-> or $obj-> is valid PHP but semantically incorrect — it implies an instance context where none is needed. Using :: makes the static nature of the call explicit and removes a layer of ambiguity for both humans and static analysis tools.

@github-actions

Copy link
Copy Markdown

Thanks for submitting a PR!

Note that draft PRs are not reviewed. If you would like a review, please mark your pull request as ready for review in the GitHub user interface.

Pull requests that are abandoned in draft may be closed due to inactivity.

@lucasmichot
lucasmichot marked this pull request as ready for review April 15, 2026 12:50
@taylorotwell
taylorotwell merged commit 1b6e77f into laravel:13.x Apr 15, 2026
52 checks passed
@lucasmichot
lucasmichot deleted the 13.x-static-calls branch April 16, 2026 10:05
jonagoldman pushed a commit to deplox/laravel-framework that referenced this pull request Apr 30, 2026
* Enfoce static calls

* StyleCI fix

---------

Co-authored-by: Lucas Michot <lucas@zaiple.com>
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.

2 participants