| Total Complexity | 5 |
| Total Lines | 55 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | final class AttachmentField |
||
| 20 | { |
||
| 21 | /** |
||
| 22 | * The required title field of the field. |
||
| 23 | * |
||
| 24 | * @var string |
||
| 25 | */ |
||
| 26 | private $title; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * The required value of the field. |
||
| 30 | * |
||
| 31 | * @var string |
||
| 32 | */ |
||
| 33 | private $value; |
||
| 34 | |||
| 35 | /** |
||
| 36 | * Whether the value is short enough to fit side by side with |
||
| 37 | * other values. |
||
| 38 | * |
||
| 39 | * @var bool |
||
| 40 | */ |
||
| 41 | private $short; |
||
| 42 | |||
| 43 | public function __construct(string $title, string $value, bool $short = false) |
||
| 44 | { |
||
| 45 | $this->title = $title; |
||
| 46 | $this->value = $value; |
||
| 47 | $this->short = $short; |
||
| 48 | } |
||
| 49 | |||
| 50 | public function getTitle(): string |
||
| 51 | { |
||
| 52 | return $this->title; |
||
| 53 | } |
||
| 54 | |||
| 55 | public function getValue(): string |
||
| 56 | { |
||
| 57 | return $this->value; |
||
| 58 | } |
||
| 59 | |||
| 60 | public function isShort(): bool |
||
| 61 | { |
||
| 62 | return $this->short; |
||
| 63 | } |
||
| 64 | |||
| 65 | /** |
||
| 66 | * Get the array representation of this attachment field. |
||
| 67 | */ |
||
| 68 | public function toArray(): array |
||
| 74 | ]; |
||
| 75 | } |
||
| 76 | } |
||
| 77 |