Re: [Reflection] Improve logic of ReflectionMethod->invokeArgs() for static methods

From: Date: Mon, 14 Jan 2013 19:58:51 +0000
Subject: Re: [Reflection] Improve logic of ReflectionMethod->invokeArgs() for static methods
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
I do not use static methods, frameworks and applications use them )).

I just want to extend logic of class methods in the application with
custom behavior (Logging, Caching) and preserve original scope. It's
already done for PHP 5.4 with closures and my library works well with
any PHP framework. For 5.3 it works only for dynamic methods and
static methods without LSB.

2013/1/14 Anthony Ferrara <[email protected]>:
> Alexander,
>
>> So, I take the original class, rename it and then create a decorator
>> class instead of original class with overridden dynamic and static
>> methods. Method in the decorator should make some specific logic and
>> then just invokes the original static method with Reflection, but the
>> scope should be also correct.
>
>
> I have to ask: *why*? Why are you using static methods like that? It seems
> to me that you're trying to use LSB to introduce a form of polymorphism
> where it's not really designed for it... Why not just use instances in this
> case (which are supported for your use-case)...?
>
> Anthony


Thread (8 messages)

« previous php.internals (#64948) next »