| Total Complexity | 5 |
| Total Lines | 56 |
| Duplicated Lines | 0 % |
| Coverage | 64.71% |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | abstract class AbstractFeatureItem extends AbstractComponent implements FeatureItemInterface |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * @Groups({"component", "content"}) |
||
| 18 | * @var string |
||
| 19 | */ |
||
| 20 | private $label; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @Groups({"component", "content"}) |
||
| 24 | * @var string|null |
||
| 25 | */ |
||
| 26 | protected $link; |
||
| 27 | |||
| 28 | 2 | public static function loadValidatorMetadata(ClassMetadata $metadata) |
|
| 29 | { |
||
| 30 | 2 | $metadata->addPropertyConstraint( |
|
| 31 | 2 | 'label', |
|
| 32 | 2 | new Assert\NotBlank() |
|
| 33 | ); |
||
| 34 | 2 | $metadata->addPropertyConstraint( |
|
| 35 | 2 | 'link', |
|
| 36 | 2 | new Assert\Url() |
|
| 37 | ); |
||
| 38 | 2 | } |
|
| 39 | |||
| 40 | /** |
||
| 41 | * @return string |
||
| 42 | */ |
||
| 43 | public function getLabel(): string |
||
| 44 | { |
||
| 45 | return $this->label; |
||
| 46 | } |
||
| 47 | |||
| 48 | /** |
||
| 49 | * @param string $label |
||
| 50 | */ |
||
| 51 | 3 | public function setLabel(string $label): void |
|
| 52 | { |
||
| 53 | 3 | $this->label = $label; |
|
| 54 | 3 | } |
|
| 55 | |||
| 56 | /** |
||
| 57 | * @return null|string |
||
| 58 | */ |
||
| 59 | public function getLink(): ?string |
||
| 60 | { |
||
| 61 | return $this->link; |
||
| 62 | } |
||
| 63 | |||
| 64 | /** |
||
| 65 | * @param null|string $link |
||
| 66 | */ |
||
| 67 | public function setLink(?string $link): void |
||
| 70 | } |
||
| 71 | } |
||
| 72 |