WordPress.org

Make WordPress Core

Ticket #53359: 53359-10-CS-remove-redundant-ignore-annotations.patch

File 53359-10-CS-remove-redundant-ignore-annotations.patch, 2.2 KB (added by jrf, 2 months ago)
  • src/wp-admin/includes/schema.php

    From 26ce822d20259762c6205f951a0cdbc1fb8deb55 Mon Sep 17 00:00:00 2001
    From: jrfnl <jrfnl@users.noreply.github.com>
    Date: Tue, 20 Jul 2021 17:58:21 +0200
    Subject: [PATCH] CS: remove redundant ignore annotations
    
    ---
     src/wp-admin/includes/schema.php    | 2 +-
     src/wp-includes/blocks/calendar.php | 8 ++------
     2 files changed, 3 insertions(+), 7 deletions(-)
    
    diff --git a/src/wp-admin/includes/schema.php b/src/wp-admin/includes/schema.php
    index 8b1e56f3af..1bb2c27c45 100644
    a b function populate_options( array $options = array() ) { 
    390390         * or a valid timezone string (America/New_York). See https://www.php.net/manual/en/timezones.php
    391391         * for all timezone strings supported by PHP.
    392392         */
    393         $offset_or_tz = _x( '0', 'default GMT offset or timezone string' ); // phpcs:ignore WordPress.WP.I18n.NoEmptyStrings
     393        $offset_or_tz = _x( '0', 'default GMT offset or timezone string' );
    394394        if ( is_numeric( $offset_or_tz ) ) {
    395395                $gmt_offset = $offset_or_tz;
    396396        } elseif ( $offset_or_tz && in_array( $offset_or_tz, timezone_identifiers_list(), true ) ) {
  • src/wp-includes/blocks/calendar.php

    diff --git a/src/wp-includes/blocks/calendar.php b/src/wp-includes/blocks/calendar.php
    index 6e0c52886a..8bde5c2694 100644
    a b function render_block_core_calendar( $attributes ) { 
    2424                        strpos( $permalink_structure, '%monthnum%' ) !== false &&
    2525                        strpos( $permalink_structure, '%year%' ) !== false
    2626                ) {
    27                         // phpcs:ignore WordPress.WP.GlobalVariablesOverride.OverrideProhibited
    2827                        $monthnum = $attributes['month'];
    29                         // phpcs:ignore WordPress.WP.GlobalVariablesOverride.OverrideProhibited
    30                         $year = $attributes['year'];
     28                        $year     = $attributes['year'];
    3129                }
    3230        }
    3331
    function render_block_core_calendar( $attributes ) { 
    3836                get_calendar( true, false )
    3937        );
    4038
    41         // phpcs:ignore WordPress.WP.GlobalVariablesOverride.OverrideProhibited
    4239        $monthnum = $previous_monthnum;
    43         // phpcs:ignore WordPress.WP.GlobalVariablesOverride.OverrideProhibited
    44         $year = $previous_year;
     40        $year     = $previous_year;
    4541
    4642        return $output;
    4743}