En raison d'une défaillance matérielle, les jobs d'intégration continue peuvent échouer sans raison évidente sur les runners partagés. Les disques incriminés devraient être changés en fin de semaine. Merci de votre compréhension.

RootNamespace.php 1.13 KB
Newer Older
1 2
<?php
/*
Guillaume Perréal's avatar
CS.  
Guillaume Perréal committed
3 4
 * Copyright (C) 2016-2017 IRSTEA
 * All rights reserved.
5 6
 */

7
namespace Irstea\PlantUmlBundle\Model\Namespace_\Php;
8

9
use Irstea\PlantUmlBundle\Model\ArrowInterface;
10 11
use Irstea\PlantUmlBundle\Writer\WriterInterface;

12
/**
Guillaume Perréal's avatar
CS.  
Guillaume Perréal committed
13
 * Description of RootNamespace.
14
 */
15
class RootNamespace extends AbstractNamespace
16
{
17 18
    const CONF_TYPE = 'php';

19
    /**
20
     * @var ArrowInterface[]
21 22 23
     */
    private $arrows = [];

24
    public function addArrow(ArrowInterface $arrow)
25 26
    {
        $this->arrows[] = $arrow;
Guillaume Perréal's avatar
CS.  
Guillaume Perréal committed
27

28 29 30
        return $this;
    }

31
    public function writeTo(WriterInterface $writer)
32
    {
33
        $writer->write("set namespaceSeparator .\n");
34
        $this
35 36 37
            ->writeNodesTo($writer)
            ->writeChildrenTo($writer)
            ->writeArrowsTo($writer);
Guillaume Perréal's avatar
CS.  
Guillaume Perréal committed
38

39 40 41
        return $this;
    }

42
    protected function writeArrowsTo(WriterInterface $writer)
43 44
    {
        foreach ($this->arrows as $arrow) {
45
            $arrow->writeTo($writer);
46
        }
Guillaume Perréal's avatar
CS.  
Guillaume Perréal committed
47

48 49
        return $this;
    }
50 51 52

    protected function getNamespacePrefix()
    {
Guillaume Perréal's avatar
CS.  
Guillaume Perréal committed
53
        return '';
54
    }
55 56 57 58 59

    public function getNodeLabel($className)
    {
        return $className;
    }
60
}