Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
23 / 23 |
|
100.00% |
15 / 15 |
CRAP | |
100.00% |
1 / 1 |
AbstractAnnotation | |
100.00% |
23 / 23 |
|
100.00% |
15 / 15 |
15 | |
100.00% |
1 / 1 |
__construct | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
setWidth | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
setHeight | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
setHRadius | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
setVRadius | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
setBorderWidth | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
setDashLength | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
setDashGap | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
getWidth | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getHeight | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getHRadius | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getVRadius | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getBorderWidth | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getDashLength | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getDashGap | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | /** |
3 | * Pop PHP Framework (https://www.popphp.org/) |
4 | * |
5 | * @link https://github.com/popphp/popphp-framework |
6 | * @author Nick Sagona, III <dev@noladev.com> |
7 | * @copyright Copyright (c) 2009-2025 NOLA Interactive, LLC. |
8 | * @license https://www.popphp.org/license New BSD License |
9 | */ |
10 | |
11 | /** |
12 | * @namespace |
13 | */ |
14 | namespace Pop\Pdf\Document\Page\Annotation; |
15 | |
16 | /** |
17 | * Pdf abstract page annotation class |
18 | * |
19 | * @category Pop |
20 | * @package Pop\Pdf |
21 | * @author Nick Sagona, III <dev@noladev.com> |
22 | * @copyright Copyright (c) 2009-2025 NOLA Interactive, LLC. |
23 | * @license https://www.popphp.org/license New BSD License |
24 | * @version 5.2.2 |
25 | */ |
26 | abstract class AbstractAnnotation implements AnnotationInterface |
27 | { |
28 | |
29 | /** |
30 | * Annotation width |
31 | * @var int |
32 | */ |
33 | protected int $width = 0; |
34 | |
35 | /** |
36 | * Annotation height |
37 | * @var int |
38 | */ |
39 | protected int $height = 0; |
40 | |
41 | /** |
42 | * Horizontal border radius |
43 | * @var int |
44 | */ |
45 | protected int $hRadius = 0; |
46 | |
47 | /** |
48 | * Vertical border radius |
49 | * @var int |
50 | */ |
51 | protected int $vRadius = 0; |
52 | |
53 | /** |
54 | * Border width |
55 | * @var int |
56 | */ |
57 | protected int $borderWidth = 0; |
58 | |
59 | /** |
60 | * Border dash length |
61 | * @var int |
62 | */ |
63 | protected int $dashLength = 0; |
64 | |
65 | /** |
66 | * Border dash gap |
67 | * @var int |
68 | */ |
69 | protected int $dashGap = 0; |
70 | |
71 | /** |
72 | * Constructor |
73 | * |
74 | * Instantiate a PDF annotation object. |
75 | * |
76 | * @param int $width |
77 | * @param int $height |
78 | */ |
79 | public function __construct(int $width, int $height) |
80 | { |
81 | $this->setWidth($width); |
82 | $this->setHeight($height); |
83 | } |
84 | |
85 | /** |
86 | * Set the width |
87 | * |
88 | * @param int $width |
89 | * @return AbstractAnnotation |
90 | */ |
91 | public function setWidth(int $width): AbstractAnnotation |
92 | { |
93 | $this->width = $width; |
94 | return $this; |
95 | } |
96 | |
97 | /** |
98 | * Set the height |
99 | * |
100 | * @param int $height |
101 | * @return AbstractAnnotation |
102 | */ |
103 | public function setHeight(int $height): AbstractAnnotation |
104 | { |
105 | $this->height = $height; |
106 | return $this; |
107 | } |
108 | |
109 | /** |
110 | * Set the horizontal border radius |
111 | * |
112 | * @param int $radius |
113 | * @return AbstractAnnotation |
114 | */ |
115 | public function setHRadius(int $radius): AbstractAnnotation |
116 | { |
117 | $this->hRadius = $radius; |
118 | return $this; |
119 | } |
120 | |
121 | /** |
122 | * Set the vertical border radius |
123 | * |
124 | * @param int $radius |
125 | * @return AbstractAnnotation |
126 | */ |
127 | public function setVRadius(int $radius): AbstractAnnotation |
128 | { |
129 | $this->vRadius = $radius; |
130 | return $this; |
131 | } |
132 | |
133 | /** |
134 | * Set the border width |
135 | * |
136 | * @param int $width |
137 | * @return AbstractAnnotation |
138 | */ |
139 | public function setBorderWidth(int $width): AbstractAnnotation |
140 | { |
141 | $this->borderWidth = $width; |
142 | return $this; |
143 | } |
144 | |
145 | /** |
146 | * Set the border dash length |
147 | * |
148 | * @param int $length |
149 | * @return AbstractAnnotation |
150 | */ |
151 | public function setDashLength(int $length): AbstractAnnotation |
152 | { |
153 | $this->dashLength = $length; |
154 | return $this; |
155 | } |
156 | |
157 | /** |
158 | * Set the border dash gap |
159 | * |
160 | * @param int $gap |
161 | * @return AbstractAnnotation |
162 | */ |
163 | public function setDashGap(int $gap): AbstractAnnotation |
164 | { |
165 | $this->dashGap = $gap; |
166 | return $this; |
167 | } |
168 | |
169 | /** |
170 | * Get the width |
171 | * |
172 | * @return int |
173 | */ |
174 | public function getWidth(): int |
175 | { |
176 | return $this->width; |
177 | } |
178 | |
179 | /** |
180 | * Get the height |
181 | * |
182 | * @return int |
183 | */ |
184 | public function getHeight(): int |
185 | { |
186 | return $this->height; |
187 | } |
188 | |
189 | /** |
190 | * Get the horizontal border radius |
191 | * |
192 | * @return int |
193 | */ |
194 | public function getHRadius(): int |
195 | { |
196 | return $this->hRadius; |
197 | } |
198 | |
199 | /** |
200 | * Get the vertical border radius |
201 | * |
202 | * @return int |
203 | */ |
204 | public function getVRadius(): int |
205 | { |
206 | return $this->vRadius; |
207 | } |
208 | |
209 | /** |
210 | * Get the border width |
211 | * |
212 | * @return int |
213 | */ |
214 | public function getBorderWidth(): int |
215 | { |
216 | return $this->borderWidth; |
217 | } |
218 | |
219 | /** |
220 | * Get the border dash length |
221 | * |
222 | * @return int |
223 | */ |
224 | public function getDashLength(): int |
225 | { |
226 | return $this->dashLength; |
227 | } |
228 | |
229 | /** |
230 | * Get the border dash gap |
231 | * |
232 | * @return int |
233 | */ |
234 | public function getDashGap(): int |
235 | { |
236 | return $this->dashGap; |
237 | } |
238 | |
239 | } |