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