Go\Core\GeneralAspectLoaderExtension::getInterceptor PHP Method

getInterceptor() protected method

protected getInterceptor ( $metaInformation, $adviceCallback ) : Go\Aop\Intercept\Interceptor
$metaInformation
$adviceCallback
return Go\Aop\Intercept\Interceptor
    protected function getInterceptor($metaInformation, $adviceCallback)
    {
        $adviceOrder = $metaInformation->order;
        $pointcutExpression = $metaInformation->value;
        switch (true) {
            case $metaInformation instanceof Annotation\Before:
                return new Framework\BeforeInterceptor($adviceCallback, $adviceOrder, $pointcutExpression);
            case $metaInformation instanceof Annotation\After:
                return new Framework\AfterInterceptor($adviceCallback, $adviceOrder, $pointcutExpression);
            case $metaInformation instanceof Annotation\Around:
                return new Framework\AroundInterceptor($adviceCallback, $adviceOrder, $pointcutExpression);
            case $metaInformation instanceof Annotation\AfterThrowing:
                return new Framework\AfterThrowingInterceptor($adviceCallback, $adviceOrder, $pointcutExpression);
            default:
                throw new \UnexpectedValueException("Unsupported method meta class: " . get_class($metaInformation));
        }
    }