Member.php 932 Bytes
Newer Older
1
<?php declare(strict_types=1);
2
/*
Guillaume Perréal's avatar
CS.    
Guillaume Perréal committed
3
4
 * Copyright (C) 2016-2017 IRSTEA
 * All rights reserved.
5
6
7
8
9
10
11
12
 */

namespace Irstea\PlantUmlBundle\Model\Node\Member;

use Irstea\PlantUmlBundle\Model\TypedSymbol;
use Irstea\PlantUmlBundle\Writer\WriterInterface;

/**
Guillaume Perréal's avatar
CS.    
Guillaume Perréal committed
13
 * Description of AbstractMember.
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
 */
class Member extends TypedSymbol implements MethodInterface, AttributeInterface
{
    /**
     * @var string
     */
    private $visibility;

    public function __construct($symbol, $type = false, $visibility = self::UNKNOWN)
    {
        parent::__construct($symbol, $type);
        $this->visibility = $visibility;
    }

    public function writeTo(WriterInterface $writer)
    {
        $writer->write($this->visibility);
        $this->writeMemberTo($writer);
        $writer->write("\n");
Guillaume Perréal's avatar
CS.    
Guillaume Perréal committed
33

34
35
36
37
38
39
40
41
        return $this;
    }

    protected function writeMemberTo(WriterInterface $writer)
    {
        return parent::writeTo($writer);
    }
}