Completed
Branch master (3b8125)
by
unknown
01:32
created

InitPropertyManager   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 44
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getProperty() 0 4 1
A setProperty() 0 5 1
A getTemplateTags() 0 7 1
1
<?php
2
3
namespace HelloWordPl\SimpleEntityGeneratorBundle\Lib\Items;
4
5
use HelloWordPl\SimpleEntityGeneratorBundle\Lib\Interfaces\RenderableInterface;
6
use Symfony\Component\Validator\Constraints as Assert;
7
use HelloWordPl\SimpleEntityGeneratorBundle\Lib\Traits\TemplateTrait;
8
9
/**
10
 * Manager for init ArrayCollection properties in constructor
11
 *
12
 * @author Sławomir Kania <[email protected]>
13
 */
14
class InitPropertyManager implements RenderableInterface
15
{
16
    use TemplateTrait;
17
18
    /**
19
     * Property
20
     *
21
     * @Assert\NotNull(message="Init property has to know about property")
22
     * @Assert\Valid()
23
     * @var PropertyManager
24
     */
25
    private $property = null;
26
27
    /**
28
     * @return PropertyManager
29
     */
30
    public function getProperty()
31
    {
32
        return $this->property;
33
    }
34
35
    /**
36
     * @param PropertyManager $property
37
     * @return ClassManager
38
     */
39
    public function setProperty(PropertyManager $property)
40
    {
41
        $this->property = $property;
42
        return $this;
43
    }
44
45
    /**
46
     * Return set of tags used in template
47
     *
48
     * @return array
49
     */
50
    public function getTemplateTags()
51
    {
52
        return [
53
            self::TAG_PROPERTY_NAME,
54
            self::TAG_PROPERTY_TYPE,
55
        ];
56
    }
57
}
58