Rectangle::getColor()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace EaselDrawing\Elements;
4
5
use EaselDrawing\AbstractElement;
6
use EaselDrawing\Color;
7
8
class Rectangle extends AbstractElement
9
{
10
    /** @var int border weight */
11
    private $thickness;
12
13
    /** @var Color */
14
    private $color;
15
16
    /**
17
     * Rectangle constructor.
18
     * @param int $x
19
     * @param int $y
20
     * @param int $width
21
     * @param int $height
22
     * @param Color $color
23
     * @param int $thickness
24
     */
25
    public function __construct(int $x, int $y, int $width, int $height, Color $color, $thickness = 1)
26
    {
27
        parent::__construct($x, $y, $width, $height);
28
        $this->thickness = $thickness;
29
        $this->color = $color;
30
    }
31
32
    public function getThickness(): int
33
    {
34
        return $this->thickness;
35
    }
36
37
    public function getColor(): Color
38
    {
39
        return $this->color;
40
    }
41
}
42