| Total Complexity | 3 |
| Total Lines | 28 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | class CssRule |
||
| 22 | { |
||
| 23 | const SELECTOR_TYPE_ID = "#"; |
||
| 24 | |||
| 25 | const SELECTOR_TYPE_CLASS = "."; |
||
| 26 | |||
| 27 | private string $selectorType; |
||
| 28 | |||
| 29 | private string $selector; |
||
| 30 | |||
| 31 | private ListInterface $directives; |
||
| 32 | |||
| 33 | public function __construct(string $selector, string $selectorType = self::SELECTOR_TYPE_CLASS) |
||
| 34 | { |
||
| 35 | $this->selector = $selector; |
||
| 36 | $this->selectorType = $selectorType; |
||
| 37 | $this->directives = emptyList(); |
||
| 38 | } |
||
| 39 | |||
| 40 | public function addDirective(string $property, string $value) |
||
| 41 | { |
||
| 42 | $this->directives->add("$property: $value;"); |
||
| 43 | } |
||
| 44 | |||
| 45 | public function __toString(): string |
||
| 49 | } |
||
| 50 | } |
||
| 51 |