Make WordPress Core


Ignore:
Timestamp:
01/08/2015 07:04:40 AM (11 years ago)
Author:
wonderboymusic
Message:

The keyword elseif should be used instead of else if so that all control keywords look like single words.

This was a mess, is now standardized across the codebase, except for a few 3rd-party libs.

See #30799.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/date.php

    r31057 r31090  
    426426            }
    427427
    428         } else if ( $day_exists && $month_exists ) {
     428        } elseif ( $day_exists && $month_exists ) {
    429429            /*
    430430             * 2. checking day, month combination
     
    608608            if ( 'relation' === $key ) {
    609609                $relation = $query['relation'];
    610             } else if ( is_array( $clause ) ) {
     610            } elseif ( is_array( $clause ) ) {
    611611
    612612                // This is a first-order clause.
     
    617617                    if ( ! $where_count ) {
    618618                        $sql_chunks['where'][] = '';
    619                     } else if ( 1 === $where_count ) {
     619                    } elseif ( 1 === $where_count ) {
    620620                        $sql_chunks['where'][] = $clause_sql['where'][0];
    621621                    } else {
     
    726726            $where_parts[] = "YEAR( $column ) $compare $value";
    727727
    728         if ( isset( $query['month'] ) && $value = $this->build_value( $compare, $query['month'] ) )
     728        if ( isset( $query['month'] ) && $value = $this->build_value( $compare, $query['month'] ) ) {
    729729            $where_parts[] = "MONTH( $column ) $compare $value";
    730         else if ( isset( $query['monthnum'] ) && $value = $this->build_value( $compare, $query['monthnum'] ) )
     730        } elseif ( isset( $query['monthnum'] ) && $value = $this->build_value( $compare, $query['monthnum'] ) ) {
    731731            $where_parts[] = "MONTH( $column ) $compare $value";
    732 
    733         if ( isset( $query['week'] ) && false !== ( $value = $this->build_value( $compare, $query['week'] ) ) )
     732        }
     733        if ( isset( $query['week'] ) && false !== ( $value = $this->build_value( $compare, $query['week'] ) ) ) {
    734734            $where_parts[] = _wp_mysql_week( $column ) . " $compare $value";
    735         else if ( isset( $query['w'] ) && false !== ( $value = $this->build_value( $compare, $query['w'] ) ) )
     735        } elseif ( isset( $query['w'] ) && false !== ( $value = $this->build_value( $compare, $query['w'] ) ) ) {
    736736            $where_parts[] = _wp_mysql_week( $column ) . " $compare $value";
    737 
     737        }
    738738        if ( isset( $query['dayofyear'] ) && $value = $this->build_value( $compare, $query['dayofyear'] ) )
    739739            $where_parts[] = "DAYOFYEAR( $column ) $compare $value";
     
    859859                );
    860860
    861             } else if ( preg_match( '/^(\d{4})\-(\d{2})$/', $datetime, $matches ) ) {
     861            } elseif ( preg_match( '/^(\d{4})\-(\d{2})$/', $datetime, $matches ) ) {
    862862                // Y-m
    863863                $datetime = array(
     
    866866                );
    867867
    868             } else if ( preg_match( '/^(\d{4})\-(\d{2})\-(\d{2})$/', $datetime, $matches ) ) {
     868            } elseif ( preg_match( '/^(\d{4})\-(\d{2})\-(\d{2})$/', $datetime, $matches ) ) {
    869869                // Y-m-d
    870870                $datetime = array(
     
    874874                );
    875875
    876             } else if ( preg_match( '/^(\d{4})\-(\d{2})\-(\d{2}) (\d{2}):(\d{2})$/', $datetime, $matches ) ) {
     876            } elseif ( preg_match( '/^(\d{4})\-(\d{2})\-(\d{2}) (\d{2}):(\d{2})$/', $datetime, $matches ) ) {
    877877                // Y-m-d H:i
    878878                $datetime = array(
Note: See TracChangeset for help on using the changeset viewer.