Rectangle   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 32
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getColor() 0 3 1
A __construct() 0 5 1
A getThickness() 0 3 1
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