Total Complexity | 3 |
Total Lines | 50 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
19 | class CssRule |
||
20 | { |
||
21 | const SELECTOR_TYPE_ID = "#"; |
||
22 | |||
23 | const SELECTOR_TYPE_CLASS = "."; |
||
24 | |||
25 | /** |
||
1 ignored issue
–
show
|
|||
26 | * @var string |
||
27 | */ |
||
28 | private $selectorType; |
||
29 | |||
30 | /** |
||
1 ignored issue
–
show
|
|||
31 | * @var string |
||
32 | */ |
||
33 | private $selector; |
||
34 | |||
35 | /** |
||
1 ignored issue
–
show
|
|||
36 | * @var ArrayList |
||
37 | */ |
||
38 | private $directives; |
||
39 | |||
40 | /** |
||
41 | * CssRule constructor. |
||
42 | * @param string $selector |
||
2 ignored issues
–
show
|
|||
43 | * @param string $selectorType |
||
1 ignored issue
–
show
|
|||
44 | */ |
||
45 | 3 | public function __construct($selector, $selectorType = self::SELECTOR_TYPE_CLASS) |
|
46 | { |
||
47 | 3 | $this->selector = $selector; |
|
48 | 3 | $this->selectorType = $selectorType; |
|
49 | 3 | $this->directives = new ArrayList(); |
|
50 | 3 | } |
|
51 | |||
52 | /** |
||
1 ignored issue
–
show
|
|||
53 | * |
||
54 | * @param string $property |
||
1 ignored issue
–
show
|
|||
55 | * @param string $value |
||
1 ignored issue
–
show
|
|||
56 | */ |
||
57 | 3 | public function addDirective($property, $value) |
|
58 | { |
||
59 | 3 | $this->directives->append("$property: $value;"); |
|
60 | 3 | } |
|
61 | |||
62 | /** |
||
1 ignored issue
–
show
|
|||
63 | * @return string |
||
64 | */ |
||
65 | 3 | public function __toString() |
|
69 | } |
||
70 | } |