Make WordPress Core


Ignore:
Timestamp:
11/30/2017 11:09:33 PM (9 years ago)
Author:
pento
Message:

Code is Poetry.
WordPress' code just... wasn't.
This is now dealt with.

Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS.
Fixes #41057.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/customize/class-wp-customize-date-time-control.php

    r42117 r42343  
    8282                $data = parent::json();
    8383
    84                 $data['maxYear'] = intval( $this->max_year );
    85                 $data['minYear'] = intval( $this->min_year );
    86                 $data['allowPastDate'] = (bool) $this->allow_past_date;
     84                $data['maxYear']          = intval( $this->max_year );
     85                $data['minYear']          = intval( $this->min_year );
     86                $data['allowPastDate']    = (bool) $this->allow_past_date;
    8787                $data['twelveHourFormat'] = (bool) $this->twelve_hour_format;
    88                 $data['includeTime'] = (bool) $this->include_time;
     88                $data['includeTime']      = (bool) $this->include_time;
    8989
    9090                return $data;
     
    9797         */
    9898        public function content_template() {
    99                 $data = array_merge( $this->json(), $this->get_month_choices() );
     99                $data          = array_merge( $this->json(), $this->get_month_choices() );
    100100                $timezone_info = $this->get_timezone_info();
    101101
     
    199199
    200200                        /* translators: 1: month number (01, 02, etc.), 2: month abbreviation */
    201                         $months[ $i ]['text'] = sprintf( __( '%1$s-%2$s' ), $i, $month_text );
     201                        $months[ $i ]['text']  = sprintf( __( '%1$s-%2$s' ), $i, $month_text );
    202202                        $months[ $i ]['value'] = $i;
    203203                }
     
    215215         */
    216216        public function get_timezone_info() {
    217                 $tz_string = get_option( 'timezone_string' );
     217                $tz_string     = get_option( 'timezone_string' );
    218218                $timezone_info = array();
    219219
     
    226226
    227227                        if ( $tz ) {
    228                                 $now = new DateTime( 'now', $tz );
    229                                 $formatted_gmt_offset = sprintf( 'UTC%s', $this->format_gmt_offset( $tz->getOffset( $now ) / 3600 ) );
    230                                 $tz_name = str_replace( '_', ' ', $tz->getName() );
     228                                $now                   = new DateTime( 'now', $tz );
     229                                $formatted_gmt_offset  = sprintf( 'UTC%s', $this->format_gmt_offset( $tz->getOffset( $now ) / 3600 ) );
     230                                $tz_name               = str_replace( '_', ' ', $tz->getName() );
    231231                                $timezone_info['abbr'] = $now->format( 'T' );
    232232
     
    237237                        }
    238238                } else {
    239                         $formatted_gmt_offset = $this->format_gmt_offset( intval( get_option( 'gmt_offset', 0 ) ) );
     239                        $formatted_gmt_offset  = $this->format_gmt_offset( intval( get_option( 'gmt_offset', 0 ) ) );
    240240                        $timezone_info['abbr'] = sprintf( 'UTC%s', $formatted_gmt_offset );
    241241
Note: See TracChangeset for help on using the changeset viewer.