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.

git-svn-id: https://develop.svn.wordpress.org/trunk@56753 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2023-10-02 11:25:35 +00:00
parent 8bbeee43b6
commit f7d73158ac
8 changed files with 12 additions and 12 deletions

View File

@@ -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();
}

View File

@@ -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();

View File

@@ -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 ];

View File

@@ -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;

View File

@@ -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.

View File

@@ -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.

View File

@@ -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;

View File

@@ -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;