An error occurred while loading the file. Please try again.
-
Raidelet Nicolas authored7b889ef8
<?php declare(strict_types=1);
/*
* Copyright (C) 2016-2017 IRSTEA
* All rights reserved.
*/
namespace Irstea\PlantUmlBundle\Model\Decorator;
use Irstea\PlantUmlBundle\Model\ArrowInterface;
use Irstea\PlantUmlBundle\Model\ClassVisitorInterface;
use Irstea\PlantUmlBundle\Model\DecoratorInterface;
use Irstea\PlantUmlBundle\Model\NodeInterface;
/**
* Description of InheritanceDecorator.
*/
abstract class AbstractRelationDecorator implements DecoratorInterface
{
/**
* @param NodeInterface $source
* @param array $classNames
* @param ClassVisitorInterface $visitor
*/
protected function visitRelations(NodeInterface $source, array $classNames, ClassVisitorInterface $visitor)
{
foreach ($classNames as $className) {
$target = $visitor->visitClass($className);
if ($target) {
$source->addArrow($this->buildRelation($source, $target));
}
}
}
/**
* @param NodeInterface $source
* @param NodeInterface $target
*
* @return ArrowInterface
*/
abstract protected function buildRelation(NodeInterface $source, NodeInterface $target);
}