Closed gmorel closed 8 years ago
@adri In your comment you were using lapistano\ProxyObject\ProxyBuilder
, and not GO-AOP, right ? Or I missed something ?
Maybe my PointCut
declaration is wrong ?
https://github.com/rezzza/TimeTraveler/pull/22/files#diff-ec9fa2630df712d9e8ff0e06e7e768dbR63
Could it be that the global namespace () is missing before Datetime in the pointcut description?
Yes I thought so
@Around("execution(public \DateTime->format(*))")
but I get a
Error: Unexpected token \ in the
execution(public \DateTime->format(*))
before Rezzza\TimeTravelerAspect->aroundNativeDateTimeFormatMethod, defined in TimeTraveler/src/TimeTravelerAspect.php:68. Expected one of: *, , namePart, |, public, protected, private, final
Hmm maybe @lisachenko has a hint? :-)
Hello, guys! Unfortunately, it's impossible to intercept built-in classes as they already loaded into the memory of PHP. This is only possible via extension, but I have some thoughts, how this can be implemented, check https://github.com/goaop/framework/issues/238 answer
This PR can be closed as well, because of limitation of goaop framework for built-in classes. However, custom source transformer can do this job, as discussed in https://github.com/goaop/framework/issues/238
tagged wontfix
Rebund of https://github.com/rezzza/TimeTraveler/issues/21
Proof of Concept
As a fundation to allow us injecting time. We need to validate GO-AOP behaviour for:
time()
\DateTime
Status
time()
is OKDateTime()->format()
is Not workingDateTime::__construct
is Not yet testedAs if the Pointcut
@Around("execution(public DateTime->format(*))")
were ignored (nothing built in the cache directory either)Test
You can run the test via