Test Failed
Branch develop (ac2838)
by Daniel
09:09
created

FeatureStackedItem::getButtonText()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Silverback\ApiComponentBundle\Entity\Component\Feature\Stacked;
4
5
use ApiPlatform\Core\Annotation\ApiResource;
6
use Doctrine\ORM\Mapping as ORM;
7
use Silverback\ApiComponentBundle\Entity\Component\Feature\AbstractFeatureItem;
8
use Symfony\Component\Serializer\Annotation\Groups;
9
use Symfony\Component\Validator\Constraints as Assert;
10
use Symfony\Component\Validator\Mapping\ClassMetadata;
11
12
/**
13
 * Class FeatureStackedItem
14
 * @package Silverback\ApiComponentBundle\Entity\Component\FeatureList
15
 * @author Daniel West <[email protected]>
16
 * @ApiResource(shortName="component/feature_stacked_items")
17
 * @ORM\Entity()
18
 */
19
class FeatureStackedItem extends AbstractFeatureItem
20
{
21
    /**
22
     * @Groups({"component", "content"})
23
     * @var null|string
24
     */
25
    protected $description;
26
27
    /**
28
     * @Groups({"component", "content"})
29
     * @var null|string
30
     */
31
    protected $buttonText;
32
33
    /**
34
     * @Groups({"component", "content"})
35
     * @var null|string
36
     */
37
    protected $buttonClass;
38
39
    public static function loadValidatorMetadata(ClassMetadata $metadata)
40
    {
41
        $metadata->addPropertyConstraint(
42
            'description',
43
            new Assert\NotBlank()
44
        );
45
    }
46
47
    /**
48
     * @return null|string
49
     */
50
    public function getDescription(): ?string
51
    {
52
        return $this->description;
53
    }
54
55
    /**
56
     * @param null|string $description
57
     */
58
    public function setDescription(?string $description): void
59
    {
60
        $this->description = $description;
61
    }
62
63
    /**
64
     * @return null|string
65
     */
66
    public function getButtonText(): ?string
67
    {
68
        return $this->buttonText;
69
    }
70
71
    /**
72
     * @param null|string $buttonText
73
     */
74
    public function setButtonText(?string $buttonText): void
75
    {
76
        $this->buttonText = $buttonText;
77
    }
78
79
    /**
80
     * @return null|string
81
     */
82
    public function getButtonClass(): ?string
83
    {
84
        return $this->buttonClass;
85
    }
86
87
    /**
88
     * @param null|string $buttonClass
89
     */
90
    public function setButtonClass(?string $buttonClass): void
91
    {
92
        $this->buttonClass = $buttonClass;
93
    }
94
}
95