Code Duplication    Length = 47-47 lines in 2 locations

src/CustomScreen/Geometry/Rectangle.php 1 location

@@ 22-68 (lines=47) @@
19
 *
20
 * @package mrcnpdlk\Grandstream\XMLApp\CustomScreen\Geometry
21
 */
22
class Rectangle
23
{
24
    /**
25
     * @var int
26
     */
27
    private $iWidth;
28
    /**
29
     * @var int
30
     */
31
    private $iHeight;
32
33
    /**
34
     * Rectangle constructor.
35
     *
36
     * @param int $w
37
     * @param int $h
38
     */
39
    public function __construct(int $w, int $h)
40
    {
41
        $this->iWidth  = $w;
42
        $this->iHeight = $h;
43
    }
44
45
    /**
46
     * @return int
47
     */
48
    public function getArea()
49
    {
50
        return $this->getHeight() * $this->getWidth();
51
    }
52
53
    /**
54
     * @return int
55
     */
56
    public function getHeight()
57
    {
58
        return $this->iHeight;
59
    }
60
61
    /**
62
     * @return int
63
     */
64
    public function getWidth()
65
    {
66
        return $this->iWidth;
67
    }
68
}
69

src/Helper/Rectangle.php 1 location

@@ 22-68 (lines=47) @@
19
 *
20
 * @package mrcnpdlk\Grandstream\XMLApp\Helper
21
 */
22
class Rectangle
23
{
24
    /**
25
     * @var int
26
     */
27
    private $iWidth;
28
    /**
29
     * @var int
30
     */
31
    private $iHeight;
32
33
    /**
34
     * Rectangle constructor.
35
     *
36
     * @param int $w
37
     * @param int $h
38
     */
39
    public function __construct(int $w, int $h)
40
    {
41
        $this->iWidth  = $w;
42
        $this->iHeight = $h;
43
    }
44
45
    /**
46
     * @return int
47
     */
48
    public function getArea()
49
    {
50
        return $this->getHeight() * $this->getWidth();
51
    }
52
53
    /**
54
     * @return int
55
     */
56
    public function getHeight()
57
    {
58
        return $this->iHeight;
59
    }
60
61
    /**
62
     * @return int
63
     */
64
    public function getWidth()
65
    {
66
        return $this->iWidth;
67
    }
68
}
69