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 $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($text, $font = null, $fontSize = null, $alignment = null, array $margins = []) |
||
62 | |||
63 | /** |
||
64 | * @inheritdoc |
||
65 | */ |
||
66 | public function updateFontSize($size) |
||
73 | |||
74 | /** |
||
75 | * @inheritdoc |
||
76 | */ |
||
77 | public function useFont($font) |
||
90 | |||
91 | /** |
||
92 | * @inheritdoc |
||
93 | */ |
||
94 | public function getFont() |
||
98 | |||
99 | /** |
||
100 | * @inheritdoc |
||
101 | */ |
||
102 | public function getText() |
||
106 | |||
107 | /** |
||
108 | * @inheritdoc |
||
109 | */ |
||
110 | public function getFontSize() |
||
114 | |||
115 | /** |
||
116 | * @inheritdoc |
||
117 | */ |
||
118 | public function getAlignment() |
||
122 | |||
123 | /** |
||
124 | * @inheritdoc |
||
125 | */ |
||
126 | public function getMargins() |
||
130 | } |
||
131 |