An error occurred while loading the file. Please try again.
-
Guillaume Perréal authoredbc58e9ca
<?php
/*
* © 2016 IRSTEA
* Guillaume Perréal <guillaume.perreal@irstea.fr>
* Tous droits réservés.
*/
namespace Irstea\PlantUmlBundle\Model\Decorator;
use Irstea\PlantUmlBundle\Model\Arrow\ExtendsClass;
use Irstea\PlantUmlBundle\Model\ClassVisitor;
use Irstea\PlantUmlBundle\Model\ClassVisitorInterface;
use Irstea\PlantUmlBundle\Model\DecoratorInterface;
use Irstea\PlantUmlBundle\Model\NodeInterface;
use ReflectionClass;
/**
* Description of InheritanceDecorator
*
* @author Guillaume Perréal <guillaume.perreal@irstea.fr>
*/
class InheritanceDecorator extends AbstractRelationDecorator
{
public function decorate(ReflectionClass $class, NodeInterface $node, ClassVisitorInterface $visitor)
{
$parent = $class->getParentClass();
if ($parent) {
$this->visitRelations($node, [$parent->getName()], $visitor);
}
}
protected function buildRelation(NodeInterface $source, NodeInterface $target)
{
return new ExtendsClass($source, $target);
}
}