Namespace_.php 1.57 KiB
<?php
/*
 * © 2016 IRSTEA
 * Guillaume Perréal <guillaume.perreal@irstea.fr>
 * Tous droits réservés.
 */
namespace Irstea\PlantUmlBundle\Model\Namespace_\Php;
use Irstea\PlantUmlBundle\Model\ArrowInterface;
use Irstea\PlantUmlBundle\Model\NamespaceInterface;
use Irstea\PlantUmlBundle\Writer\WriterInterface;
/**
 * Description of Namespace
 * @author Guillaume Perréal <guillaume.perreal@irstea.fr>
class Namespace_ extends AbstractHierachicalNamespace
    /**
     * @var AbstractNamespace
    private $parent;
    /**
     * @var string
    private $name;
    public function __construct(AbstractHierachicalNamespace $parent, $name)
        $this->parent = $parent;
        $this->name = $name;
    /**
     * @param ArrowInterface $arrow
     * @return self
    public function addArrow(ArrowInterface $arrow)
        $this->parent->addArrow($arrow);
        return $this;
    /**
     * @return string
    protected function getNamespacePrefix()
        return $this->parent->getNamespacePrefix() . $this->name . '\\';
        /**
     * @param resource WriterInterface $writer
     * @return self
    public function outputTo(WriterInterface $writer)
        if ($this->isEmpty()) {
            return;
        $writer
            ->printf("namespace %s {\n", $this->name)
            ->indent();
        $this
            ->outputNodesTo($writer)
717273747576777879
->outputChildrenTo($writer); $writer ->dedent() ->write("}\n"); return $this; } }