Total Complexity | 8 |
Total Lines | 62 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | class RectangleCoordinate |
||
10 | { |
||
11 | private int $x; |
||
12 | private int $y; |
||
13 | private int $width; |
||
14 | private int $height; |
||
15 | |||
16 | public function __construct(int $x, int $y, int $width, int $height) |
||
17 | { |
||
18 | $this->x = $x; |
||
19 | $this->y = $y; |
||
20 | $this->width = $width; |
||
21 | $this->height = $height; |
||
22 | } |
||
23 | |||
24 | public function getWidth() : int |
||
25 | { |
||
26 | return $this->width; |
||
27 | } |
||
28 | |||
29 | public function getHeight() : int |
||
32 | } |
||
33 | |||
34 | public function getTopLeft() : PixelCoordinate |
||
35 | { |
||
36 | return new PixelCoordinate( |
||
37 | $this->x, |
||
38 | $this->y |
||
39 | ); |
||
40 | } |
||
41 | |||
42 | public function getTopRight() : PixelCoordinate |
||
47 | ); |
||
48 | } |
||
49 | |||
50 | public function getBottomLeft() : PixelCoordinate |
||
55 | ); |
||
56 | } |
||
57 | |||
58 | public function getBottomRight() : PixelCoordinate |
||
59 | { |
||
60 | return new PixelCoordinate( |
||
61 | $this->x + $this->width, |
||
62 | $this->y + $this->height |
||
63 | ); |
||
64 | } |
||
65 | |||
66 | public function getSize() : ImageHelper_Size |
||
71 | )); |
||
72 | } |
||
73 | } |
||
74 |