1 | <?php |
||
17 | class Label implements LabelInterface |
||
18 | { |
||
19 | /** |
||
20 | * @var string |
||
21 | */ |
||
22 | protected $text; |
||
23 | /** |
||
24 | * @var int |
||
25 | */ |
||
26 | protected $fontSize; |
||
27 | /** |
||
28 | * @var string |
||
29 | */ |
||
30 | protected $font; |
||
31 | /** |
||
32 | * @var string |
||
33 | */ |
||
34 | protected $alignment; |
||
35 | /** |
||
36 | * @var array |
||
37 | */ |
||
38 | protected $margins = [ |
||
39 | 't' => 0, |
||
40 | 'r' => 10, |
||
41 | 'b' => 10, |
||
42 | 'l' => 10, |
||
43 | ]; |
||
44 | |||
45 | /** |
||
46 | * Label constructor. |
||
47 | * |
||
48 | * @param string $text |
||
49 | * @param string|null $font |
||
50 | * @param int|null $fontSize |
||
51 | * @param string|null $alignment |
||
52 | * @param array $margins |
||
53 | */ |
||
54 | public function __construct(string $text, string $font = null, $fontSize = null, $alignment = null, array $margins = []) |
||
62 | |||
63 | /** |
||
64 | * @inheritdoc |
||
65 | */ |
||
66 | public function setFontSize(int $size): LabelInterface |
||
72 | |||
73 | /** |
||
74 | * @inheritdoc |
||
75 | * @throws InvalidPathException |
||
76 | */ |
||
77 | public function setFont(string $font): LabelInterface |
||
88 | |||
89 | /** |
||
90 | * @inheritdoc |
||
91 | */ |
||
92 | public function getFont(): string |
||
96 | |||
97 | /** |
||
98 | * @inheritdoc |
||
99 | */ |
||
100 | public function getText(): string |
||
104 | |||
105 | /** |
||
106 | * @inheritdoc |
||
107 | */ |
||
108 | public function getFontSize(): int |
||
112 | |||
113 | /** |
||
114 | * @inheritdoc |
||
115 | */ |
||
116 | public function getAlignment(): string |
||
120 | |||
121 | /** |
||
122 | * @inheritdoc |
||
123 | */ |
||
124 | public function getMargins(): array |
||
128 | } |
||
129 |