Skip to content

Commit

Permalink
Revert "Try abstract class instead of interface"
Browse files Browse the repository at this point in the history
This reverts commit 74881651faf991eabceb090707ce8b43c2a25316.
  • Loading branch information
sirreal committed Dec 5, 2024
1 parent 86eabe0 commit 32778c8
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

final class WP_CSS_Attribute_Selector extends WP_CSS_HTML_Tag_Processor_Matcher {
final class WP_CSS_Attribute_Selector implements WP_CSS_HTML_Tag_Processor_Matcher {
const WHITESPACE_CHARACTERS = " \t\r\n\f";

public function matches( WP_HTML_Tag_Processor $processor ): bool {
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
@@ -1,6 +1,6 @@
<?php

final class WP_CSS_Class_Selector extends WP_CSS_HTML_Tag_Processor_Matcher {
final class WP_CSS_Class_Selector implements WP_CSS_HTML_Tag_Processor_Matcher {
public function matches( WP_HTML_Tag_Processor $processor ): bool {
return (bool) $processor->has_class( $this->ident );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
*
* @access private
*/
class WP_CSS_Complex_Selector_List extends WP_CSS_Compound_Selector_List {
class WP_CSS_Complex_Selector_List extends WP_CSS_Compound_Selector_List implements WP_CSS_HTML_Processor_Matcher {
/**
* Takes a CSS selector string and returns an instance of itself or `null` if the selector
* string is invalid or unsupported.
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 @@ -5,7 +5,7 @@
*
* > <complex-selector> = <compound-selector> [ <combinator>? <compound-selector> ] *
*/
final class WP_CSS_Complex_Selector extends WP_CSS_HTML_Processor_Matcher {
final class WP_CSS_Complex_Selector implements WP_CSS_HTML_Processor_Matcher {
public function matches( WP_HTML_Processor $processor ): bool {
// First selector must match this location.
if ( ! $this->selectors[0]->matches( $processor ) ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
* @link https://www.w3.org/TR/selectors-api2/
* @link https://www.w3.org/TR/selectors-4/
*/
class WP_CSS_Compound_Selector_List extends WP_CSS_HTML_Tag_Processor_Matcher {
class WP_CSS_Compound_Selector_List implements WP_CSS_HTML_Tag_Processor_Matcher {
/**
* @param WP_HTML_Tag_Processor $processor
* @return bool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* > <compound-selector> = [ <type-selector>? <subclass-selector>* ]!
*/
final class WP_CSS_Compound_Selector extends WP_CSS_HTML_Tag_Processor_Matcher {
final class WP_CSS_Compound_Selector implements WP_CSS_HTML_Tag_Processor_Matcher {
public function matches( WP_HTML_Tag_Processor $processor ): bool {
if ( $this->type_selector ) {
if ( ! $this->type_selector->matches( $processor ) ) {
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
@@ -1,6 +1,6 @@
<?php

final class WP_CSS_ID_Selector extends WP_CSS_HTML_Tag_Processor_Matcher {
final class WP_CSS_ID_Selector implements WP_CSS_HTML_Tag_Processor_Matcher {
/** @var string */
public $ident;

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
@@ -1,6 +1,6 @@
<?php

final class WP_CSS_Type_Selector extends WP_CSS_HTML_Tag_Processor_Matcher {
final class WP_CSS_Type_Selector implements WP_CSS_HTML_Tag_Processor_Matcher {
public function matches( WP_HTML_Tag_Processor $processor ): bool {
$tag_name = $processor->get_tag();
if ( null === $tag_name ) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

abstract class WP_CSS_HTML_Processor_Matcher {
interface WP_CSS_HTML_Processor_Matcher {
/**
* @return bool
*/
abstract public function matches( WP_HTML_Processor $processor ): bool;
public function matches( WP_HTML_Processor $processor ): bool;
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

abstract class WP_CSS_HTML_Tag_Processor_Matcher {
interface WP_CSS_HTML_Tag_Processor_Matcher {
/**
* @return bool
*/
abstract public function matches( WP_HTML_Tag_Processor $processor ): bool;
public function matches( WP_HTML_Tag_Processor $processor ): bool;
}

0 comments on commit 32778c8

Please sign in to comment.