protected function createLink(LinkAnnotation $annotation): Link
    {
        if (! preg_match(self::RESOURCE_PATTERN, $annotation->resource, $matches)) {
            throw new \LogicException(sprintf('Invalid resource definition: "%s"', $annotation->resource));
        }

        $link = new Link(
            $annotation->name,
            $matches['repository'],
            $matches['link']
        );

        $link->setParameters($annotation->parameters);
        $link->setMetadata($annotation->metadata);

        return $link;
    }
protected function createLink(LinkAnnotation $annotation): Link
    {
        if (! preg_match(self::RESOURCE_PATTERN, $annotation->resource, $matches)) {
            throw new \LogicException(sprintf('Invalid resource definition: "%s"', $annotation->resource));
        }

        $link = new Link(
            $annotation->name,
            $matches['repository'],
            $matches['link']
        );

        $link->setParameters($annotation->parameters);
        $link->setMetadata($annotation->metadata);

        return $link;
    }
protected function createLink ( LinkAnnotation $ annotation ) : Link { if ( ! preg_match ( self :: RESOURCE_PATTERN , $ annotation -> resource , $ matches ) ) { throw new \ LogicException ( sprintf ( 'Invalid resource definition: "%s"' , $ annotation -> resource ) ) ; } $ link = new Link ( $ annotation -> name , $ matches [ 'repository' ] , $ matches [ 'link' ] ) ; $ link -> setParameters ( $ annotation -> parameters ) ; $ link -> setMetadata ( $ annotation -> metadata ) ; return $ link ; }
Create link by link's annotation

@param  LinkAnnotation $annotation
@return Link
Create link by link s annotation