Skip to content

Commit

Permalink
Remove php 8+ ?static return types
Browse files Browse the repository at this point in the history
  • Loading branch information
sirreal committed Dec 11, 2024
1 parent 40d914b commit fff9309
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ private function whitespace_delimited_list( string $input ): Generator {
* will be updated if the parse is successful.
* @return static|null The selector instance, or null if the parse was unsuccessful.
*/
public static function parse( string $input, int &$offset ): ?static {
public static function parse( string $input, int &$offset ) {
// Need at least 3 bytes [x]
if ( $offset + 2 >= strlen( $input ) ) {
return null;
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/html-api/class-wp-css-class-selector.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function matches( WP_HTML_Tag_Processor $processor ): bool {
* will be updated if the parse is successful.
* @return static|null The selector instance, or null if the parse was unsuccessful.
*/
public static function parse( string $input, int &$offset ): ?static {
public static function parse( string $input, int &$offset ) {
if ( $offset + 1 >= strlen( $input ) || '.' !== $input[ $offset ] ) {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class WP_CSS_Complex_Selector_List extends WP_CSS_Compound_Selector_List {
* will be updated if the parse is successful.
* @return static|null The selector instance, or null if the parse was unsuccessful.
*/
public static function parse( string $input, int &$offset ): ?static {
public static function parse( string $input, int &$offset ) {
$selector = WP_CSS_Complex_Selector::parse( $input, $offset );
if ( null === $selector ) {
return null;
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/html-api/class-wp-css-complex-selector.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ private function explore_matches( array $selectors, array $breadcrumbs ): bool {
* will be updated if the parse is successful.
* @return static|null The selector instance, or null if the parse was unsuccessful.
*/
public static function parse( string $input, int &$offset ): ?static {
public static function parse( string $input, int &$offset ) {
if ( $offset >= strlen( $input ) ) {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ protected function __construct( array $selectors ) {
* @param string $input CSS selectors.
* @return static|null
*/
public static function from_selectors( string $input ): ?static {
public static function from_selectors( string $input ) {
$input = self::normalize_selector_input( $input );

if ( '' === $input ) {
Expand All @@ -142,7 +142,7 @@ public static function from_selectors( string $input ): ?static {
* will be updated if the parse is successful.
* @return static|null The selector instance, or null if the parse was unsuccessful.
*/
public static function parse( string $input, int &$offset ): ?static {
public static function parse( string $input, int &$offset ) {
$selector = WP_CSS_Compound_Selector::parse( $input, $offset );
if ( null === $selector ) {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function matches( WP_HTML_Tag_Processor $processor ): bool {
* will be updated if the parse is successful.
* @return static|null The selector instance, or null if the parse was unsuccessful.
*/
public static function parse( string $input, int &$offset ): ?static {
public static function parse( string $input, int &$offset ) {
if ( $offset >= strlen( $input ) ) {
return null;
}
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/html-api/class-wp-css-id-selector.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function matches( WP_HTML_Tag_Processor $processor ): bool {
* will be updated if the parse is successful.
* @return static|null The selector instance, or null if the parse was unsuccessful.
*/
public static function parse( string $input, int &$offset ): ?static {
public static function parse( string $input, int &$offset ) {
$ident = self::parse_hash_token( $input, $offset );
if ( null === $ident ) {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ abstract public function matches( WP_HTML_Tag_Processor $processor ): bool;
* will be updated if the parse is successful.
* @return static|null The selector instance, or null if the parse was unsuccessful.
*/
abstract public static function parse( string $input, int &$offset ): ?static;
abstract public static function parse( string $input, int &$offset );

/*
* ------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/html-api/class-wp-css-type-selector.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function matches_tag( string $tag_name ): bool {
* will be updated if the parse is successful.
* @return static|null The selector instance, or null if the parse was unsuccessful.
*/
public static function parse( string $input, int &$offset ): ?static {
public static function parse( string $input, int &$offset ) {
if ( $offset >= strlen( $input ) ) {
return null;
}
Expand Down

0 comments on commit fff9309

Please sign in to comment.