From 0424a6e124f47640b7b56908c90297671265ee4a Mon Sep 17 00:00:00 2001 From: Takayuki Miyoshi Date: Sun, 16 Jun 2024 18:15:09 +0900 Subject: [PATCH] Rename $args to $options #1369 --- includes/config-validator/validator.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/includes/config-validator/validator.php b/includes/config-validator/validator.php index c75c123c..b531d0c5 100644 --- a/includes/config-validator/validator.php +++ b/includes/config-validator/validator.php @@ -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']; } } @@ -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' => '', ) ); @@ -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; } @@ -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; }