Skip to content

Commit ac2fb56

Browse files
committed
More documentation improvements
1 parent c572391 commit ac2fb56

4 files changed

Lines changed: 6 additions & 8 deletions

File tree

src/wp-includes/html-api/class-wp-css-attribute-selector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ public function matches( WP_HTML_Tag_Processor $processor ): bool {
217217
*
218218
* @param string $input
219219
*
220-
* @return Generator<string>
220+
* @return Generator<string> Yields each whitespace-delimited value from the input string.
221221
*/
222222
private function whitespace_delimited_list( string $input ): Generator {
223223
// Start by skipping whitespace.

src/wp-includes/html-api/class-wp-css-complex-selector.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ final class WP_CSS_Complex_Selector extends WP_CSS_Selector_Parser_Matcher {
9999
* Constructor.
100100
*
101101
* @param WP_CSS_Compound_Selector $self_selector The selector in the final position.
102-
* @param array{WP_CSS_Type_Selector, string}[]|null $selectors The context selectors.
102+
* @param array{WP_CSS_Type_Selector, string}[]|null $context_selectors The context selectors.
103103
*/
104104
private function __construct(
105105
WP_CSS_Compound_Selector $self_selector,
@@ -246,7 +246,7 @@ public static function parse( string $input, int &$offset ) {
246246
return null;
247247
}
248248

249-
/** @var array{WP_CSS_Compound_Selector, string} */
249+
/** @var array{WP_CSS_Type_Selector, string} */
250250
$selector_pair = array( $self_selector->type_selector, $combinator );
251251
$selectors[] = $selector_pair;
252252
$self_selector = $next_selector;

src/wp-includes/html-api/class-wp-css-compound-selector-list.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@
5151
* - ID selectors (e.g. `#unique-id`)
5252
* - Attribute selectors (e.g. `[attribute-name]` or `[attribute-name="value"]`)
5353
* - Comma-separated selector lists (e.g. `.selector-1, .selector-2`)
54-
* - The following combinators. Only type (element) selectors are allowed in non-final position:
55-
* - descendant (e.g. `el .descendant`)
56-
* - child (`el > .child`)
54+
* - Compound selectors (e.g. `div.class-name#id[attr]`)
5755
*
5856
* Unsupported selector syntax:
5957
* - Pseudo-element selectors (`::before`)

src/wp-includes/html-api/class-wp-css-selector-parser-matcher.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ final protected static function parse_hash_token( string $input, int &$offset ):
123123
* the <bad-string-token> is not a part of the selector grammar. That
124124
* case is treated as failure to parse and null is returned.
125125
*
126-
* @return string|null
126+
* @return string|null The parsed string token value, or null if parsing failed.
127127
*/
128128
final protected static function parse_string( string $input, int &$offset ): ?string {
129129
if ( $offset >= strlen( $input ) ) {
@@ -278,7 +278,7 @@ final protected static function consume_escaped_codepoint( $input, &$offset ): s
278278
*
279279
* https://www.w3.org/TR/css-syntax-3/#consume-name
280280
*
281-
* @return string|null
281+
* @return string|null The parsed identifier name, or null if parsing failed.
282282
*/
283283
final protected static function parse_ident( string $input, int &$offset ): ?string {
284284
if ( ! self::check_if_three_code_points_would_start_an_ident_sequence( $input, $offset ) ) {

0 commit comments

Comments
 (0)