| Total Complexity | 13 |
| Total Lines | 106 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 7 | ||
| Bugs | 2 | Features | 0 |
| 1 | <?php |
||
| 7 | class ImageFont |
||
| 8 | { |
||
| 9 | const FONTTYPE_INTERNAL = 1; |
||
| 10 | const FONTTYPE_TTF = 2; |
||
| 11 | |||
| 12 | private $color = [0, 0, 0]; |
||
| 13 | private $text; |
||
| 14 | private $angle = 0; |
||
| 15 | private $size = 8; |
||
| 16 | private $fontType; |
||
| 17 | private $font; |
||
| 18 | |||
| 19 | public function __construct($text = '') |
||
| 20 | { |
||
| 21 | $this->text = $text; |
||
| 22 | } |
||
| 23 | |||
| 24 | public function font($fontFile) |
||
| 25 | { |
||
| 26 | $this->fontType = is_int($fontFile) |
||
| 27 | ? self::FONTTYPE_INTERNAL |
||
| 28 | : self::FONTTYPE_TTF; |
||
| 29 | |||
| 30 | $this->font = $fontFile; |
||
| 31 | } |
||
| 32 | |||
| 33 | public function size($size) |
||
| 38 | } |
||
| 39 | |||
| 40 | public function angle($angle) |
||
| 45 | } |
||
| 46 | |||
| 47 | public function color(array $color) |
||
| 52 | } |
||
| 53 | |||
| 54 | private function createColor($image) |
||
| 55 | { |
||
| 56 | return imagecolorallocate( |
||
| 57 | $image, |
||
| 58 | $this->color[0], |
||
| 59 | $this->color[1], |
||
| 60 | $this->color[2] |
||
| 61 | ); |
||
| 62 | } |
||
| 63 | |||
| 64 | public function align($align) |
||
|
|
|||
| 65 | { |
||
| 66 | } |
||
| 67 | |||
| 68 | public function text($text) |
||
| 73 | } |
||
| 74 | |||
| 75 | public function valign($align) |
||
| 77 | } |
||
| 78 | |||
| 79 | /** |
||
| 80 | * Get text bounding box |
||
| 81 | * |
||
| 82 | * @return void |
||
| 83 | */ |
||
| 84 | public function getBoundingBox(): array |
||
| 85 | { |
||
| 86 | return imageftbbox($this->size, $this->angle, $this->font, $this->text); |
||
| 87 | } |
||
| 88 | |||
| 89 | public function apply(&$image, $x = 0, $y = 0) |
||
| 113 | ); |
||
| 114 | } |
||
| 116 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.