Skip to content

Commit

Permalink
Make most selector constructors private
Browse files Browse the repository at this point in the history
  • Loading branch information
sirreal committed Dec 11, 2024
1 parent e193621 commit 85e4d6a
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ final class WP_CSS_Attribute_Selector extends WP_CSS_Selector_Parser_Matcher {
* @param string|null $modifier The attribute case modifier.
* Must be one of the class MODIFIER_* constants or null.
*/
public function __construct( string $name, ?string $matcher = null, ?string $value = null, ?string $modifier = null ) {
private function __construct( string $name, ?string $matcher = null, ?string $value = null, ?string $modifier = null ) {
$this->name = $name;
$this->matcher = $matcher;
$this->value = $value;
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 @@ -29,7 +29,7 @@ final class WP_CSS_Class_Selector extends WP_CSS_Selector_Parser_Matcher {
*
* @param string $class_name The class name to match.
*/
public function __construct( string $class_name ) {
private function __construct( string $class_name ) {
$this->class_name = $class_name;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ final class WP_CSS_Compound_Selector extends WP_CSS_Selector_Parser_Matcher {
* @param (WP_CSS_ID_Selector|WP_CSS_Class_Selector|WP_CSS_Attribute_Selector)[]|null $subclass_selectors
* The array of subclass selectors or null.
*/
public function __construct( ?WP_CSS_Type_Selector $type_selector, ?array $subclass_selectors ) {
private function __construct( ?WP_CSS_Type_Selector $type_selector, ?array $subclass_selectors ) {
$this->type_selector = $type_selector;
$this->subclass_selectors = array() === $subclass_selectors ? null : $subclass_selectors;
}
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 @@ -29,7 +29,7 @@ final class WP_CSS_ID_Selector extends WP_CSS_Selector_Parser_Matcher {
*
* @param string $id The ID to match.
*/
public function __construct( string $id ) {
private function __construct( string $id ) {
$this->id = $id;
}

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 @@ -29,7 +29,7 @@ final class WP_CSS_Type_Selector extends WP_CSS_Selector_Parser_Matcher {
*
* @param string $type The element type (tag name) to match or '*' to match any element.
*/
public function __construct( string $type ) {
private function __construct( string $type ) {
$this->type = $type;
}

Expand Down

0 comments on commit 85e4d6a

Please sign in to comment.