@@ -240,7 +240,7 @@ private function handle_wp_set_option_autoload_values( array $options_param, $st
240240 $ array_token = $ this ->phpcsFile ->findNext (
241241 Tokens::$ emptyTokens ,
242242 $ options_param ['start ' ],
243- $ options_param ['end ' ],
243+ ( $ options_param ['end ' ] + 1 ) ,
244244 true
245245 );
246246
@@ -311,8 +311,8 @@ private function maybe_display_missing_autoload_warning( $stackPtr, $function_na
311311 *
312312 * @since 3.2.0
313313 *
314- * @param array $autoload_info Information about the autoload value (start and end tokens and
315- * the clean value).
314+ * @param array $autoload_info Information about the autoload value (start and end tokens,
315+ * the clean value and potentially the "raw" value - which isn't used ).
316316 * @param string $function_name The token content (function name) which was matched
317317 * in lowercase.
318318 *
@@ -369,7 +369,7 @@ private function check_autoload_value( array $autoload_info, $function_name ) {
369369 if ( $ param_second_token
370370 && false === isset ( Collections::arrayOpenTokensBC ()[ $ this ->tokens [ $ param_first_token ]['code ' ] ] )
371371 ) {
372- // Bail early if the parameter has two or more non-empty tokens and the second token is
372+ // Bail early if the parameter has two or more non-empty tokens and the first token is
373373 // not an array opener as this means an undetermined param value or a value that is not
374374 // easy to determine.
375375 $ this ->phpcsFile ->recordMetric ( $ param_first_token , self ::METRIC_NAME , 'undetermined value ' );
@@ -401,13 +401,7 @@ private function check_autoload_value( array $autoload_info, $function_name ) {
401401 $ error_code = 'InternalUseOnly ' ;
402402 $ data = array ( $ autoload_info ['clean ' ] );
403403 } else {
404- $ valid_values = array_map (
405- function ( $ value ) {
406- return '` ' . $ value . '` ' ;
407- },
408- $ valid_values
409- );
410- $ valid_values_string = implode ( ', ' , $ valid_values );
404+ $ valid_values_string = '` ' . implode ( '`, ` ' , $ valid_values ) . '` ' ;
411405 $ valid_values_string = substr_replace ( $ valid_values_string , ' or ' , strrpos ( $ valid_values_string , ', ' ), 1 );
412406 $ message = 'The use of `%s` as the value of the `$autoload` parameter is invalid. Use %s instead. ' ;
413407 $ error_code = 'InvalidValue ' ;
@@ -422,7 +416,7 @@ function ( $value ) {
422416 $ data
423417 );
424418
425- if ( $ fix ) {
419+ if ( true === $ fix ) {
426420 $ this ->phpcsFile ->fixer ->replaceToken ( $ param_first_token , $ this ->fixable_values [ $ autoload_value ] );
427421 }
428422
0 commit comments