| Total Complexity | 4 |
| Total Lines | 60 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class Dimensions |
||
| 8 | { |
||
| 9 | |||
| 10 | /** |
||
| 11 | * width |
||
| 12 | * |
||
| 13 | * @var int |
||
| 14 | */ |
||
| 15 | protected $width; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * height |
||
| 19 | * |
||
| 20 | * @var int |
||
| 21 | */ |
||
| 22 | protected $height; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * instanciate |
||
| 26 | * |
||
| 27 | * @param integer $width |
||
| 28 | * @param integer $height |
||
| 29 | */ |
||
| 30 | 2 | public function __construct(int $width = 0, int $height = 0) |
|
| 31 | { |
||
| 32 | 2 | $this->set($width, $height); |
|
| 33 | } |
||
| 34 | |||
| 35 | /** |
||
| 36 | * set width and height |
||
| 37 | * |
||
| 38 | * @param integer $width |
||
| 39 | * @param integer $height |
||
| 40 | * @return Dimensions |
||
| 41 | */ |
||
| 42 | 2 | public function set(int $width, int $height): Dimensions |
|
| 43 | { |
||
| 44 | 2 | $this->width = $width; |
|
| 45 | 2 | $this->height = $height; |
|
| 46 | 2 | return $this; |
|
| 47 | } |
||
| 48 | |||
| 49 | /** |
||
| 50 | * returns width |
||
| 51 | * |
||
| 52 | * @return integer |
||
| 53 | */ |
||
| 54 | 1 | public function width(): int |
|
| 55 | { |
||
| 56 | 1 | return $this->width; |
|
| 57 | } |
||
| 58 | |||
| 59 | /** |
||
| 60 | * returns height |
||
| 61 | * |
||
| 62 | * @return integer |
||
| 63 | */ |
||
| 64 | 1 | public function height(): int |
|
| 67 | } |
||
| 68 | } |
||
| 69 |