| Total Complexity | 5 |
| Total Lines | 54 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 7 | class ParsedSelector |
||
| 8 | { |
||
| 9 | /** @var null|string */ |
||
| 10 | private $selector; |
||
| 11 | |||
| 12 | /** @var ICssFilter[] */ |
||
| 13 | private $functions; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @param null|string $selector |
||
| 17 | * @param ICssFilter[] $functions |
||
| 18 | */ |
||
| 19 | public function __construct(?string $selector = null, array $functions = []) |
||
| 20 | { |
||
| 21 | $this->selector = $selector; |
||
| 22 | $this->functions = $functions; |
||
| 23 | } |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @return null|string; |
||
| 27 | */ |
||
| 28 | public function getSelector(): ?string |
||
| 29 | { |
||
| 30 | return $this->selector; |
||
| 31 | } |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @return ICssFilter[] |
||
| 35 | */ |
||
| 36 | public function getFunctions(): array |
||
| 37 | { |
||
| 38 | return $this->functions; |
||
| 39 | } |
||
| 40 | |||
| 41 | /** |
||
| 42 | * Return the function at a specific index. |
||
| 43 | * |
||
| 44 | * @param int $index |
||
| 45 | * |
||
| 46 | * @return ICssFilter|null |
||
| 47 | */ |
||
| 48 | public function getFunction(int $index = 0): ?ICssFilter |
||
| 51 | } |
||
| 52 | |||
| 53 | /** |
||
| 54 | * Get the number of functions. |
||
| 55 | * |
||
| 56 | * @return int |
||
| 57 | */ |
||
| 58 | public function getFunctionCount(): int |
||
| 63 |