Closed ncou closed 2 years ago
Injector correctly work with method __callStatic()
, I'm added test: https://github.com/yiisoft/injector/pull/58.
But you right, reason of error is wrap callable to Closure
. Problem in class InvokerTestStaticMagicMethodFixture
: static
use current scope, but in Closure scope is changed. For fix replace static::$wasCalled = true;
to self::$wasCalled = true;
.
Hi,
nice piece of code. I think i found a small bug during a test using a __callStatic function (but i think it should appen with all statically called functions).
I got this error :
Error: Cannot access static:: when no class scope is active
when i do the following test :I think it's because the original callable is wrapped around a Closure, but the static scope is not binded. But i am not really sure :-)
Tell me if you need more details. Keep up the good work.