Static macro call that calls another static macro: Warning: Cannot unbind $this of closure using $this #54424
Unanswered
cosmastech
asked this question in
Ideas
Replies: 1 comment 1 reply
-
If you use $this in the macro you can't call it as static. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Laravel Version
11.41.2
PHP Version
8.3
Database Driver & Version
n/a
Description
Not sure at what version of PHP this would've started happening, but in my production code, I get the following warning:
Steps To Reproduce
To reproduce:
One possible solution is inside of
Macroable::__callStatic()
to build an instance of the class from the container, rather than binding it to null.though I think that's a bit inelegant, clunky, and admittedly I don't know all the ramifications of it.
Beta Was this translation helpful? Give feedback.
All reactions