diff --git a/includes/Checker/Checks/Abstract_PHP_CodeSniffer_Check.php b/includes/Checker/Checks/Abstract_PHP_CodeSniffer_Check.php index bf669dc9b..5a1c87c22 100644 --- a/includes/Checker/Checks/Abstract_PHP_CodeSniffer_Check.php +++ b/includes/Checker/Checks/Abstract_PHP_CodeSniffer_Check.php @@ -30,10 +30,11 @@ abstract class Abstract_PHP_CodeSniffer_Check implements Static_Check { * @var array */ protected $allowed_args = array( - 'standard' => true, - 'extensions' => true, - 'sniffs' => true, - 'exclude' => true, //phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude + 'standard' => true, + 'extensions' => true, + 'sniffs' => true, + 'runtime-set' => true, + 'exclude' => true, //phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude ); /** @@ -145,7 +146,15 @@ private function parse_argv( $argv, $defaults ) { // Format check arguments for PHPCS. foreach ( $check_args as $key => $value ) { - $defaults[] = "--{$key}=$value"; + if ( 'runtime-set' === $key ) { + if ( is_array( $value ) ) { + foreach ( $value as $runtime_item_key => $runtime_item_value ) { + $defaults = array_merge( $defaults, array( "--{$key}", $runtime_item_key, $runtime_item_value ) ); + } + } + } else { + $defaults[] = "--{$key}=$value"; + } } return $defaults;