Skip to content

Commit a293ba1

Browse files
committed
Add description for interface.
Change `getStringValue()` to `getValue()` (and also for `setValue()`).
1 parent 6562f64 commit a293ba1

1 file changed

Lines changed: 22 additions & 2 deletions

File tree

src/Property/Selector/SelectorComponent.php

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,37 @@
44

55
namespace Sabberworm\CSS\Property\Selector;
66

7+
/**
8+
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Selectors/Selector_structure
9+
*
10+
* A complex selector is a sequence of one or more simple and/or compound selectors that are separated by combinators,
11+
* including the white space descendant combinator.
12+
*
13+
* This is essentially a 'selector', as a 'selector list' is a list of comma-separated selectors.
14+
*
15+
* A compound selector is a superset that includes a simple selector:
16+
* - `li` is a simple selector (but can be treated as a compound selector);
17+
* - `li:last-child` is a compound selector;
18+
* - `ul li:last-child` is a complex selector as it has a combinator (the whitespace descendent combinator).
19+
*
20+
* A (complex) selector can be decomposed thus:
21+
* selector = compound-selector [combinator, compound-selector]*
22+
*
23+
* It's a list of alternating types.
24+
*
25+
* This interface covers both types, so they can be put into an array of the interface type.
26+
*/
727
interface SelectorComponent
828
{
929
/**
1030
* @return non-empty-string
1131
*/
12-
public function getStringValue(): string;
32+
public function getValue(): string;
1333

1434
/**
1535
* @param non-empty-string $value
1636
*/
17-
public function setStringValue(string $value): void;
37+
public function setValue(string $value): void;
1838

1939
/**
2040
* @return int<0, max>

0 commit comments

Comments
 (0)