Total Complexity | 5 |
Total Lines | 71 |
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 | /** |
||
44 | * @param string $title |
||
45 | * @param string $value |
||
46 | * @param bool $short |
||
47 | */ |
||
48 | public function __construct(string $title, string $value, bool $short = false) |
||
49 | { |
||
50 | $this->title = $title; |
||
51 | $this->value = $value; |
||
52 | $this->short = $short; |
||
53 | } |
||
54 | |||
55 | /** |
||
56 | * @return string |
||
57 | */ |
||
58 | public function getTitle(): string |
||
59 | { |
||
60 | return $this->title; |
||
61 | } |
||
62 | |||
63 | /** |
||
64 | * @return string |
||
65 | */ |
||
66 | public function getValue(): string |
||
67 | { |
||
68 | return $this->value; |
||
69 | } |
||
70 | |||
71 | /** |
||
72 | * @return bool |
||
73 | */ |
||
74 | public function isShort(): bool |
||
75 | { |
||
76 | return $this->short; |
||
77 | } |
||
78 | |||
79 | /** |
||
80 | * Get the array representation of this attachment field. |
||
81 | * |
||
82 | * @return array |
||
83 | */ |
||
84 | public function toArray() |
||
90 | ]; |
||
91 | } |
||
92 | } |
||
93 |