Skip to content

Commit 26ad776

Browse files
committed
Explain annotation
1 parent c10e0d3 commit 26ad776

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

‎src/wp-includes/html-api/class-wp-html-tag-processor.php‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2216,7 +2216,14 @@ private function parse_all_attributes(): void {
22162216
}
22172217

22182218
$attribute_start = $this->bytes_already_parsed;
2219-
/** @phpstan-var non-empty-string $attribute_name */
2219+
/**
2220+
* Attribute name.
2221+
*
2222+
* The name is non-empty because whitespace and slashes are skipped, `>` ends parsing,
2223+
* and a leading `=` is included. PHPStan cannot infer this, so the type is annotated below.
2224+
*
2225+
* @var non-empty-string $attribute_name
2226+
*/
22202227
$attribute_name = substr( $this->html, $attribute_start, $name_length );
22212228
$this->bytes_already_parsed += $name_length;
22222229

0 commit comments

Comments
 (0)