Skip to content
Matthias Molitor edited this page Mar 24, 2012 · 2 revisions

Pointcut Proposal

Pointcuts are represented by classes that implement the AspectPHP_Pointcut interface. The interface requires only the method matches():

interface AspectPHP_Pointcut {
    public function matches($method);
}

matches() receives the method as string that contains class and method name (MyClass::myMethod). It has to return true if the pointcut matches the given method and false otherwise.

By providing class and method name simple RegExp pointcuts as well as complex pointcuts that rely on reflection are possible.

Later it may be interesting to distinguish between pointcuts that may be evaluated during weaving and pointcuts that can only be evaluated at runtime. But for the first version this distinction will be ignored.

Clone this wiki locally