Go\Core\AbstractAspectLoaderExtension::parseTokenStream PHP Method

parseTokenStream() protected method

Performs parsing of pointcut
protected parseTokenStream ( ReflectionMetho\ReflectionMethod | ReflectionPropert\ReflectionProperty $reflection, BaseAnnotation $metaInformation, Dissect\Lexer\TokenStream\TokenStream $stream ) : Go\Aop\Pointcut
$reflection ReflectionMetho\ReflectionMethod | ReflectionPropert\ReflectionProperty
$metaInformation Go\Lang\Annotation\BaseAnnotation
$stream Dissect\Lexer\TokenStream\TokenStream
return Go\Aop\Pointcut
    protected function parseTokenStream($reflection, $metaInformation, $stream)
    {
        try {
            $pointcut = $this->pointcutParser->parse($stream);
        } catch (UnexpectedTokenException $e) {
            $token = $e->getToken();
            $message = "Unexpected token %s in the `%s` before %s, defined in %s:%d." . PHP_EOL;
            $message .= "Expected one of: %s";
            $message = sprintf($message, $token->getValue(), $metaInformation->value, (isset($reflection->class) ? $reflection->class . '->' : '') . $reflection->name, method_exists($reflection, 'getFileName') ? $reflection->getFileName() : $reflection->getDeclaringClass()->getFileName(), method_exists($reflection, 'getStartLine') ? $reflection->getStartLine() : 0, join(', ', $e->getExpected()));
            throw new \UnexpectedValueException($message, 0, $e);
        }
        return $pointcut;
    }