Skip to content

Commit 0cffcb1

Browse files
committed
Clarify style processor factory contract
1 parent a61e707 commit 0cffcb1

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

docs/wp-html-style-attribute-processor-spec.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,14 @@ The processor's north star is:
2323
Creation uses:
2424

2525
```php
26-
WP_HTML_Style_Attribute_Processor::create( string $decoded_css_text ): static
26+
WP_HTML_Style_Attribute_Processor::create( $decoded_css_text )
2727
```
2828

29-
The constructor is private. `create()` always returns a processor instance for a
30-
string input.
29+
The constructor is private. `create()` accepts only string input and returns a
30+
processor instance of the called class. The implementation must remain
31+
compatible with WordPress' supported PHP versions, so the runtime signature may
32+
use PHPDoc and explicit validation instead of PHP syntax unavailable in those
33+
versions.
3134

3235
Callers must not pass raw `WP_HTML_Tag_Processor::get_attribute( 'style' )`
3336
results directly unless they have already checked that the result is a string.
@@ -60,7 +63,7 @@ The internal declaration data consists of:
6063
Initial public methods:
6164

6265
```php
63-
public static function create( string $decoded_css_text ): static;
66+
public static function create( $decoded_css_text );
6467
public function next_declaration( ?string $property_name = null ): bool;
6568
public function get_property_name(): ?string;
6669
public function is_important(): ?bool;

0 commit comments

Comments
 (0)