WordPress.org

Make WordPress Core


Ignore:
Timestamp:
05/16/2020 06:40:52 PM (11 months ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use strict comparison where static strings are involved.

This reduces the number of WordPress.PHP.StrictComparisons.LooseComparison issues in half, from 1897 to 890.

Includes minor code layout fixes for better readability.

See #49542.

File:
1 edited

Legend:

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

    r47219 r47808  
    6464    global $shortcode_tags;
    6565
    66     if ( '' == trim( $tag ) ) {
     66    if ( '' === trim( $tag ) ) {
    6767        $message = __( 'Invalid shortcode name: Empty name given.' );
    6868        _doing_it_wrong( __FUNCTION__, $message, '4.4.0' );
     
    387387
    388388    foreach ( $textarr as &$element ) {
    389         if ( '' == $element || '<' !== $element[0] ) {
     389        if ( '' === $element || '<' !== $element[0] ) {
    390390            continue;
    391391        }
     
    512512 * @param string $text
    513513 * @return array|string List of attribute values.
    514  *                      Returns empty array if trim( $text ) == '""'.
    515  *                      Returns empty string if trim( $text ) == ''.
     514 *                      Returns empty array if '""' === trim( $text ).
     515 *                      Returns empty string if '' === trim( $text ).
    516516 *                      All other matches are checked for not empty().
    517517 */
Note: See TracChangeset for help on using the changeset viewer.