From ffd72aac28dc0e0eb7aa9857abd2a7099344fe3f Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 2 Oct 2023 11:27:24 +0000 Subject: [PATCH] Coding Standards: Remove redundant ignore annotations, take 5. The `VariableAnalysis` standard is not used by WP Core. Follow-up to [50958], [51003], [52049], [52051], [52069], [53072], [54132], [55132], [56363], [56738], [56743], [56751], [56752]. Props jrf. See #59161. Built from https://develop.svn.wordpress.org/trunk@56753 git-svn-id: http://core.svn.wordpress.org/trunk@56265 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/block-supports/dimensions.php | 2 +- wp-includes/blocks.php | 2 +- wp-includes/class-wp-theme-json-schema.php | 2 +- wp-includes/functions.php | 2 +- wp-includes/html-api/class-wp-html-open-elements.php | 8 ++++---- .../endpoints/class-wp-rest-global-styles-controller.php | 4 ++-- .../class-wp-rest-pattern-directory-controller.php | 2 +- .../endpoints/class-wp-rest-templates-controller.php | 2 +- wp-includes/version.php | 2 +- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/wp-includes/block-supports/dimensions.php b/wp-includes/block-supports/dimensions.php index c4bb6bcda9..a889e78a16 100644 --- a/wp-includes/block-supports/dimensions.php +++ b/wp-includes/block-supports/dimensions.php @@ -50,7 +50,7 @@ function wp_register_dimensions_support( $block_type ) { * @param array $block_attributes Block attributes. * @return array Block dimensions CSS classes and inline styles. */ -function wp_apply_dimensions_support( $block_type, $block_attributes ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable +function wp_apply_dimensions_support( $block_type, $block_attributes ) { if ( wp_should_skip_block_supports_serialization( $block_type, 'dimensions' ) ) { return array(); } diff --git a/wp-includes/blocks.php b/wp-includes/blocks.php index d48ee3fa57..45acfd90d8 100644 --- a/wp-includes/blocks.php +++ b/wp-includes/blocks.php @@ -549,7 +549,7 @@ function register_block_type_from_metadata( $file_or_folder, $args = array() ) { * * @return string Returns the block content. */ - $settings['render_callback'] = static function ( $attributes, $content, $block ) use ( $template_path ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + $settings['render_callback'] = static function ( $attributes, $content, $block ) use ( $template_path ) { ob_start(); require $template_path; return ob_get_clean(); diff --git a/wp-includes/class-wp-theme-json-schema.php b/wp-includes/class-wp-theme-json-schema.php index 63c45005bc..46712a032b 100644 --- a/wp-includes/class-wp-theme-json-schema.php +++ b/wp-includes/class-wp-theme-json-schema.php @@ -140,7 +140,7 @@ class WP_Theme_JSON_Schema { * @param array $path Path to the property to be removed. */ private static function unset_setting_by_path( &$settings, $path ) { - $tmp_settings = &$settings; // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + $tmp_settings = &$settings; $last_key = array_pop( $path ); foreach ( $path as $key ) { $tmp_settings = &$tmp_settings[ $key ]; diff --git a/wp-includes/functions.php b/wp-includes/functions.php index d070c1695a..4b6bc14acf 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -5079,7 +5079,7 @@ function _wp_array_set( &$input_array, $path, $value = null ) { ) { $input_array[ $path_element ] = array(); } - $input_array = &$input_array[ $path_element ]; // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.VariableRedeclaration + $input_array = &$input_array[ $path_element ]; } $input_array[ $path[ $i ] ] = $value; diff --git a/wp-includes/html-api/class-wp-html-open-elements.php b/wp-includes/html-api/class-wp-html-open-elements.php index 035717b444..fe5625545b 100644 --- a/wp-includes/html-api/class-wp-html-open-elements.php +++ b/wp-includes/html-api/class-wp-html-open-elements.php @@ -110,7 +110,7 @@ class WP_HTML_Open_Elements { * @param string[] $termination_list List of elements that terminate the search. * @return bool Whether the element was found in a specific scope. */ - public function has_element_in_specific_scope( $tag_name, $termination_list ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + public function has_element_in_specific_scope( $tag_name, $termination_list ) { foreach ( $this->walk_up() as $node ) { if ( $node->node_name === $tag_name ) { return true; @@ -167,7 +167,7 @@ class WP_HTML_Open_Elements { * @param string $tag_name Name of tag to check. * @return bool Whether given element is in scope. */ - public function has_element_in_list_item_scope( $tag_name ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + public function has_element_in_list_item_scope( $tag_name ) { throw new WP_HTML_Unsupported_Exception( 'Cannot process elements depending on list item scope.' ); return false; // The linter requires this unreachable code until the function is implemented and can return. @@ -199,7 +199,7 @@ class WP_HTML_Open_Elements { * @param string $tag_name Name of tag to check. * @return bool Whether given element is in scope. */ - public function has_element_in_table_scope( $tag_name ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + public function has_element_in_table_scope( $tag_name ) { throw new WP_HTML_Unsupported_Exception( 'Cannot process elements depending on table scope.' ); return false; // The linter requires this unreachable code until the function is implemented and can return. @@ -217,7 +217,7 @@ class WP_HTML_Open_Elements { * @param string $tag_name Name of tag to check. * @return bool Whether given element is in scope. */ - public function has_element_in_select_scope( $tag_name ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + public function has_element_in_select_scope( $tag_name ) { throw new WP_HTML_Unsupported_Exception( 'Cannot process elements depending on select scope.' ); return false; // The linter requires this unreachable code until the function is implemented and can return. diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php index 58ef874bd8..9837f535e2 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php @@ -358,7 +358,7 @@ class WP_REST_Global_Styles_Controller extends WP_REST_Controller { * @param WP_REST_Request $request Request object. * @return WP_REST_Response Response object. */ - public function prepare_item_for_response( $post, $request ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + public function prepare_item_for_response( $post, $request ) { $raw_config = json_decode( $post->post_content, true ); $is_global_styles_user_theme_json = isset( $raw_config['isGlobalStylesUserThemeJSON'] ) && true === $raw_config['isGlobalStylesUserThemeJSON']; $config = array(); @@ -641,7 +641,7 @@ class WP_REST_Global_Styles_Controller extends WP_REST_Controller { * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has read access for the item, WP_Error object otherwise. */ - public function get_theme_items_permissions_check( $request ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + public function get_theme_items_permissions_check( $request ) { /* * Verify if the current user has edit_theme_options capability. * This capability is required to edit/view/delete templates. diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-pattern-directory-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-pattern-directory-controller.php index 31dca825bb..41f37c9f1d 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-pattern-directory-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-pattern-directory-controller.php @@ -106,7 +106,7 @@ class WP_REST_Pattern_Directory_Controller extends WP_REST_Controller { $query_args = array_intersect_key( $request->get_params(), $valid_query_args ); $query_args['locale'] = get_user_locale(); - $query_args['wp-version'] = $wp_version; // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable -- it's defined in `version.php` above. + $query_args['wp-version'] = $wp_version; $query_args['pattern-categories'] = isset( $request['category'] ) ? $request['category'] : false; $query_args['pattern-keywords'] = isset( $request['keyword'] ) ? $request['keyword'] : false; diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-templates-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-templates-controller.php index 4ca84ad03c..e9904ff234 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-templates-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-templates-controller.php @@ -633,7 +633,7 @@ class WP_REST_Templates_Controller extends WP_REST_Controller { * @param WP_REST_Request $request Request object. * @return WP_REST_Response Response object. */ - public function prepare_item_for_response( $item, $request ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + public function prepare_item_for_response( $item, $request ) { // Restores the more descriptive, specific name for use within this method. $template = $item; diff --git a/wp-includes/version.php b/wp-includes/version.php index 5fb797f6e1..cc890b01fe 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.4-beta1-56752'; +$wp_version = '6.4-beta1-56753'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.