| Total Complexity | 10 |
| Total Lines | 59 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 5 | class Canvas |
||
| 6 | { |
||
| 7 | /** @var int */ |
||
| 8 | private $width; |
||
| 9 | /** @var int */ |
||
| 10 | private $height; |
||
| 11 | /** @var Elements */ |
||
| 12 | private $elements; |
||
| 13 | /** @var Color */ |
||
| 14 | private $background; |
||
| 15 | /** @var bool */ |
||
| 16 | private $grayScale; |
||
| 17 | /** @var Orientation */ |
||
| 18 | private $orientation; |
||
| 19 | |||
| 20 | public function __construct( |
||
| 21 | int $width, |
||
| 22 | int $height, |
||
| 23 | Color $background = null, |
||
| 24 | Elements $elements = null, |
||
| 25 | bool $grayScale = false, |
||
| 26 | Orientation $orientation = null |
||
| 27 | ) { |
||
| 28 | $this->width = $width; |
||
| 29 | $this->height = $height; |
||
| 30 | $this->elements = $elements ? : new Elements(); |
||
| 31 | $this->background = $background ? : new Color(255, 255, 255); |
||
| 32 | $this->grayScale = $grayScale; |
||
| 33 | $this->orientation = $orientation ? : new Orientation(Orientation::LANDSCAPE); |
||
| 34 | } |
||
| 35 | |||
| 36 | public function getWidth(): int |
||
| 37 | { |
||
| 38 | return $this->width; |
||
| 39 | } |
||
| 40 | |||
| 41 | public function getHeight(): int |
||
| 42 | { |
||
| 43 | return $this->height; |
||
| 44 | } |
||
| 45 | |||
| 46 | public function getElements(): Elements |
||
| 47 | { |
||
| 48 | return $this->elements; |
||
| 49 | } |
||
| 50 | |||
| 51 | public function getBackground(): Color |
||
| 52 | { |
||
| 53 | return $this->background; |
||
| 54 | } |
||
| 55 | |||
| 56 | public function isGrayScale(): bool |
||
| 59 | } |
||
| 60 | |||
| 61 | public function getOrientation(): Orientation |
||
| 64 | } |
||
| 65 | } |
||
| 66 |