PhpBench\Benchmark\Metadata\AnnotationReader::parse PHP Метод

parse() приватный Метод

Delegates to the doctrine DocParser but catches annotation not found errors and throws something useful.
См. также: Doctrine\Common\Annotations\DocParser
private parse ( $input, $context = '' )
    private function parse($input, $context = '')
    {
        try {
            $annotations = $this->docParser->parse($input, $context);
        } catch (AnnotationException $e) {
            if (!preg_match('/The annotation "(.*)" .* was never imported/', $e->getMessage(), $matches)) {
                throw $e;
            }
            throw new \InvalidArgumentException(sprintf('Unrecognized annotation %s, valid PHPBench annotations: @%s', $matches[1], implode(', @', array_keys(self::$phpBenchImports))), null, $e);
        }
        return $annotations;
    }