EzSystems\PlatformBehatBundle\Context\Argument\AnnotationArgumentResolver::parseAnnotations PHP Method

parseAnnotations() private method

Returns an array with the method arguments service requirements, if the methods use the service Annotation.
private parseAnnotations ( $annotations ) : array
return array array of methods and their service dependencies
    private function parseAnnotations($annotations)
    {
        // parse array from (numeric key => 'annotation <value>') to (annotation => value)
        $methodServices = [];
        foreach ($annotations as $annotation) {
            if (!preg_match('/^(\\w+)\\s+\\$(\\w+)\\s+([\\w\\.\\@\\%]+)/', $annotation, $matches)) {
                continue;
            }
            array_shift($matches);
            $tag = array_shift($matches);
            if ($tag == self::SERVICE_DOC_TAG) {
                list($argument, $service) = $matches;
                $methodServices[$argument] = $service;
            }
        }
        return $methodServices;
    }