| Total Complexity | 3 |
| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Coverage | 50% |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | class SimpleImage extends AbstractComponent implements FileInterface |
||
| 18 | { |
||
| 19 | use FileTrait; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @ORM\Column(nullable=true) |
||
| 23 | * @Groups({"component", "content"}) |
||
| 24 | * @var null|string |
||
| 25 | */ |
||
| 26 | protected $caption; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @param ClassMetadata $metadata |
||
| 30 | */ |
||
| 31 | 1 | public static function loadValidatorMetadata(ClassMetadata $metadata) |
|
| 32 | { |
||
| 33 | 1 | $metadata->addPropertyConstraints( |
|
| 34 | 1 | 'filePath', |
|
| 35 | 1 | [new Assert\NotBlank()] // , new Assert\Image() |
|
| 36 | ); |
||
| 37 | 1 | } |
|
| 38 | |||
| 39 | /** |
||
| 40 | * @return null|string |
||
| 41 | */ |
||
| 42 | public function getCaption(): ?string |
||
| 43 | { |
||
| 44 | return $this->caption; |
||
| 45 | } |
||
| 46 | |||
| 47 | /** |
||
| 48 | * @param null|string $caption |
||
| 49 | * @return SimpleImage |
||
| 50 | */ |
||
| 51 | public function setCaption(?string $caption): self |
||
| 55 | } |
||
| 56 | } |
||
| 57 |