Total Complexity | 6 |
Total Lines | 46 |
Duplicated Lines | 0 % |
Coverage | 71.43% |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
5 | class Size |
||
6 | { |
||
7 | const REGEXP_SIZE_VALIDATION = '/^(?P<size>\d*\.?\d+)(?P<unit>pt|px|em)?$/i'; |
||
8 | |||
9 | /** |
||
10 | * @var bool |
||
11 | */ |
||
12 | protected $valid; |
||
13 | |||
14 | /** |
||
15 | * @var string |
||
16 | */ |
||
17 | protected $size = ''; |
||
18 | |||
19 | /** |
||
20 | * @var string |
||
21 | */ |
||
22 | protected $unit = ''; |
||
23 | |||
24 | 29 | public function __construct(string $size) |
|
30 | } |
||
31 | 29 | } |
|
32 | |||
33 | 29 | public function valid(): bool |
|
34 | { |
||
35 | 29 | return $this->valid; |
|
36 | } |
||
37 | |||
38 | public function size(): string |
||
39 | { |
||
40 | return $this->size; |
||
41 | } |
||
42 | |||
43 | public function unit(): string |
||
46 | } |
||
47 | |||
48 | 28 | public function __toString() |
|
51 | } |
||
52 | } |
||
53 |