Passed
Push — master ( 77414c...fb8c39 )
by Daniel
12:16
created

AbstractFeature   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Test Coverage

Coverage 71.43%

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 33
ccs 5
cts 7
cp 0.7143
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getTitle() 0 3 1
A setTitle() 0 4 1
A onDeleteCascade() 0 3 1
A __construct() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Silverback\ApiComponentBundle\Entity\Component\Feature;
6
7
use Doctrine\ORM\Mapping as ORM;
8
use Silverback\ApiComponentBundle\Entity\Component\AbstractComponent;
9
use Silverback\ApiComponentBundle\Entity\Content\ComponentGroup\ComponentGroup;
10
use Symfony\Component\Serializer\Annotation\Groups;
11
12
abstract class AbstractFeature extends AbstractComponent
13
{
14
    /**
15
     * @ORM\Column()
16 2
     * @Groups({"component", "content"})
17
     * @var null|string
18 2
     */
19 2
    protected $title;
20 2
21 2
    public function __construct()
22
    {
23
        parent::__construct();
24
        $this->addValidComponent(AbstractFeatureItem::class);
25
        $this->addComponentGroup(new ComponentGroup());
26
    }
27
28
    /**
29
     * @return null|string
30
     */
31
    public function getTitle(): ?string
32
    {
33
        return $this->title;
34
    }
35
36
    public function setTitle(?string $title): self
37
    {
38
        $this->title = $title;
39
        return $this;
40
    }
41
42
    public function onDeleteCascade(): bool
43
    {
44
        return true;
45
    }
46
}
47