Skip to content

Commit

Permalink
Rename $args to $options
Browse files Browse the repository at this point in the history
  • Loading branch information
takayukister committed Jun 16, 2024
1 parent 4421d9a commit 0424a6e
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions includes/config-validator/validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,20 +70,20 @@ public static function get_doc_link( $child_page = '' ) {
/**
* Constructor.
*/
public function __construct( WPCF7_ContactForm $contact_form, $args = '' ) {
$args = wp_parse_args( $args, array(
public function __construct( WPCF7_ContactForm $contact_form, $options = '' ) {
$options = wp_parse_args( $options, array(
'include' => null,
'exclude' => null,
) );

$this->contact_form = $contact_form;

if ( isset( $args['include'] ) ) {
$this->include = (array) $args['include'];
if ( isset( $options['include'] ) ) {
$this->include = (array) $options['include'];
}

if ( isset( $args['exclude'] ) ) {
$this->exclude = (array) $args['exclude'];
if ( isset( $options['exclude'] ) ) {
$this->exclude = (array) $options['exclude'];
}
}

Expand Down Expand Up @@ -125,8 +125,8 @@ public function supports( $error_code ) {
/**
* Counts detected errors.
*/
public function count_errors( $args = '' ) {
$args = wp_parse_args( $args, array(
public function count_errors( $options = '' ) {
$options = wp_parse_args( $options, array(
'section' => '',
'code' => '',
) );
Expand All @@ -138,9 +138,9 @@ public function count_errors( $args = '' ) {
$key = sprintf( 'mail.%s', $matches[1] );
}

if ( $args['section']
and $key !== $args['section']
and preg_replace( '/\..*$/', '', $key, 1 ) !== $args['section'] ) {
if ( $options['section']
and $key !== $options['section']
and preg_replace( '/\..*$/', '', $key, 1 ) !== $options['section'] ) {
continue;
}

Expand All @@ -149,7 +149,7 @@ public function count_errors( $args = '' ) {
continue;
}

if ( $args['code'] and $error['code'] !== $args['code'] ) {
if ( $options['code'] and $error['code'] !== $options['code'] ) {
continue;
}

Expand Down

0 comments on commit 0424a6e

Please sign in to comment.