WordPress.org

Make WordPress Core

Ticket #44028: 44028.1.diff

File 44028.1.diff, 9.0 KB (added by seusmaniqbal, 3 years ago)

Yoda conditions fixes

  • wp-includes/ID3/getid3.lib.php

    diff --git a/wp-includes/ID3/getid3.lib.php b/wp-includes/ID3/getid3.lib.php
    index 1931bb3724..0004817313 100644
    a b class getid3_lib 
    2727                                $returnstring .= ' ';
    2828                        }
    2929                }
    30                 if (!empty($htmlencoding)) {
    31                         if ($htmlencoding === true) {
     30                if ( ! empty($htmlencoding) ) {
     31                        if ( true === $htmlencoding ) {
    3232                                $htmlencoding = 'UTF-8'; // prior to getID3 v1.9.0 the function's 4th parameter was boolean
    3333                        }
    3434                        $returnstring = htmlentities($returnstring, ENT_QUOTES, $htmlencoding);
  • wp-includes/ID3/module.audio-video.matroska.php

    diff --git a/wp-includes/ID3/module.audio-video.matroska.php b/wp-includes/ID3/module.audio-video.matroska.php
    index 825a22e192..0b6e9df251 100644
    a b class getid3_matroska extends getid3_handler 
    13191319
    13201320                // get raw data
    13211321                $dont_parse = (in_array($element['id'], $this->unuseful_elements) || $element['id_name'] == dechex($element['id']));
    1322                 if (($get_data === true || (is_array($get_data) && !in_array($element['id'], $get_data))) && !$dont_parse) {
     1322                if ((true === $get_data || (is_array($get_data) && !in_array($element['id'], $get_data))) && !$dont_parse) {
    13231323                        $element['data'] = $this->readEBMLelementData($element['length'], $element);
    13241324                }
    13251325
  • wp-includes/ID3/module.tag.apetag.php

    diff --git a/wp-includes/ID3/module.tag.apetag.php b/wp-includes/ID3/module.tag.apetag.php
    index eb081b4967..2db56a3cdc 100644
    a b class getid3_apetag extends getid3_handler 
    270270                                                }
    271271                                                $thisfile_ape_items_current['image_mime'] = image_type_to_mime_type($imagechunkcheck[2]);
    272272
    273                                                 if ($this->inline_attachments === false) {
     273                                                if ( false === $this->inline_attachments ) {
    274274                                                        // skip entirely
    275275                                                        unset($thisfile_ape_items_current['data']);
    276276                                                        break;
    277277                                                }
    278                                                 if ($this->inline_attachments === true) {
     278                                                if ( true === $this->inline_attachments ) {
    279279                                                        // great
    280280                                                } elseif (is_int($this->inline_attachments)) {
    281281                                                        if ($this->inline_attachments < $thisfile_ape_items_current['data_length']) {
  • wp-includes/ID3/module.tag.id3v2.php

    diff --git a/wp-includes/ID3/module.tag.id3v2.php b/wp-includes/ID3/module.tag.id3v2.php
    index fc586e8e13..d04c060a92 100644
    a b class getid3_id3v2 extends getid3_handler 
    14461446                                                unset($parsedFrame['data']);
    14471447                                                break;
    14481448                                        }
    1449                                         if ($this->getid3->option_save_attachments === true) {
     1449                                        if ( true === $this->getid3->option_save_attachments ) {
    14501450                                                // great
    14511451/*
    14521452                                        } elseif (is_int($this->getid3->option_save_attachments)) {
  • wp-includes/IXR/class-IXR-introspectionserver.php

    diff --git a/wp-includes/IXR/class-IXR-introspectionserver.php b/wp-includes/IXR/class-IXR-introspectionserver.php
    index 5628d81caa..35a39fe6d5 100644
    a b class IXR_IntrospectionServer extends IXR_Server 
    102102                    }
    103103                    break;
    104104                case 'boolean':
    105                     if ($arg !== false && $arg !== true) {
     105                    if ( false !== $arg && true !== $arg ) {
    106106                        $ok = false;
    107107                    }
    108108                    break;
  • wp-includes/IXR/class-IXR-value.php

    diff --git a/wp-includes/IXR/class-IXR-value.php b/wp-includes/IXR/class-IXR-value.php
    index 0fd878bcac..e718484035 100644
    a b class IXR_Value { 
    4141
    4242    function calculateType()
    4343    {
    44         if ($this->data === true || $this->data === false) {
     44        if ( true  === $this->data || false === $this->data ) {
    4545            return 'boolean';
    4646        }
    4747        if (is_integer($this->data)) {
  • wp-includes/Requests/Cookie.php

    diff --git a/wp-includes/Requests/Cookie.php b/wp-includes/Requests/Cookie.php
    index 00fbbc73be..03f5ada796 100644
    a b class Requests_Cookie { 
    149149
    150150                // If the cookie is marked as host-only and we don't have an exact
    151151                // match, reject the cookie
    152                 if ($this->flags['host-only'] === true) {
     152                if ( true === $this->flags['host-only'] ) {
    153153                        return false;
    154154                }
    155155
  • wp-includes/Requests/SSL.php

    diff --git a/wp-includes/Requests/SSL.php b/wp-includes/Requests/SSL.php
    index 2b0376853a..c8eb13346b 100644
    a b class Requests_SSL { 
    6464                // alt names, as per RFC2818
    6565                if (!$has_dns_alt && !empty($cert['subject']['CN'])) {
    6666                        // Check for a match
    67                         if (self::match_domain($host, $cert['subject']['CN']) === true) {
     67                        if ( true === self::match_domain( $host, $cert['subject']['CN'] ) ) {
    6868                                return true;
    6969                        }
    7070                }
  • wp-includes/class-requests.php

    diff --git a/wp-includes/class-requests.php b/wp-includes/class-requests.php
    index bb266189c1..58d379c400 100644
    a b class Requests { 
    682682
    683683                $options['hooks']->dispatch('requests.before_redirect_check', array(&$return, $req_headers, $req_data, $options));
    684684
    685                 if ($return->is_redirect() && $options['follow_redirects'] === true) {
     685                if ( $return->is_redirect() && true === $options['follow_redirects'] ) {
    686686                        if (isset($return->headers['location']) && $options['redirected'] < $options['redirects']) {
    687687                                if ($return->status_code === 303) {
    688688                                        $options['type'] = self::GET;
  • wp-includes/class-simplepie.php

    diff --git a/wp-includes/class-simplepie.php b/wp-includes/class-simplepie.php
    index 6110413767..c8a5767a70 100644
    a b class SimplePie 
    13141314                        }
    13151315
    13161316                        // Fetch the data via SimplePie_File into $this->raw_data
    1317                         if (($fetched = $this->fetch_data($cache)) === true)
     1317                        if ( true === ( $fetched = $this->fetch_data( $cache ) ) )
    13181318                        {
    13191319                                return true;
    13201320                        }
  • wp-includes/class-wp-http-curl.php

    diff --git a/wp-includes/class-wp-http-curl.php b/wp-includes/class-wp-http-curl.php
    index 12508cf5e2..0abd007021 100644
    a b class WP_Http_Curl { 
    129129
    130130                curl_setopt( $handle, CURLOPT_URL, $url );
    131131                curl_setopt( $handle, CURLOPT_RETURNTRANSFER, true );
    132                 curl_setopt( $handle, CURLOPT_SSL_VERIFYHOST, ( $ssl_verify === true ) ? 2 : false );
     132                curl_setopt( $handle, CURLOPT_SSL_VERIFYHOST, ( true === $ssl_verify ) ? 2 : false );
    133133                curl_setopt( $handle, CURLOPT_SSL_VERIFYPEER, $ssl_verify );
    134134
    135135                if ( $ssl_verify ) {
  • wp-includes/class-wp-xmlrpc-server.php

    diff --git a/wp-includes/class-wp-xmlrpc-server.php b/wp-includes/class-wp-xmlrpc-server.php
    index 948564abce..fefed92550 100644
    a b class wp_xmlrpc_server extends IXR_Server { 
    41794179                                continue;
    41804180                        }
    41814181
    4182                         if ( $this->blog_options[ $o_name ]['readonly'] == true ) {
     4182                        if ( true == $this->blog_options[ $o_name ]['readonly'] ) {
    41834183                                continue;
    41844184                        }
    41854185
  • wp-includes/formatting.php

    diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php
    index 5bda6e82a9..d1be8d0ceb 100644
    a b function _make_web_ftp_clickable_cb( $matches ) { 
    28142814        $dest = 'http://' . $dest;
    28152815
    28162816        // removed trailing [.,;:)] from URL
    2817         if ( in_array( substr( $dest, -1 ), array( '.', ',', ';', ':', ')' ) ) === true ) {
     2817        if ( true === in_array( substr( $dest, -1 ), array( '.', ',', ';', ':', ')' ) ) ) {
    28182818                $ret  = substr( $dest, -1 );
    28192819                $dest = substr( $dest, 0, strlen( $dest ) - 1 );
    28202820        }
  • wp-includes/js/codemirror/csslint.js

    diff --git a/wp-includes/js/codemirror/csslint.js b/wp-includes/js/codemirror/csslint.js
    index 4b84fc34d2..1c6bf2ce73 100644
    a b Matcher.many = function(required) { 
    504504        return acc;
    505505    }, []);
    506506
    507     if (required === true) {
     507    if ( true === required ) {
    508508        required = ms.map(function() {
    509509            return true;
    510510        });
  • wp-includes/post.php

    diff --git a/wp-includes/post.php b/wp-includes/post.php
    index 98ad57fbd0..3e76916b3a 100644
    a b function _add_post_type_submenus() { 
    16371637        foreach ( get_post_types( array( 'show_ui' => true ) ) as $ptype ) {
    16381638                $ptype_obj = get_post_type_object( $ptype );
    16391639                // Sub-menus only.
    1640                 if ( ! $ptype_obj->show_in_menu || $ptype_obj->show_in_menu === true ) {
     1640                if ( ! $ptype_obj->show_in_menu || true === $ptype_obj->show_in_menu ) {
    16411641                        continue;
    16421642                }
    16431643                add_submenu_page( $ptype_obj->show_in_menu, $ptype_obj->labels->name, $ptype_obj->labels->all_items, $ptype_obj->cap->edit_posts, "edit.php?post_type=$ptype" );
  • wp-includes/widgets.php

    diff --git a/wp-includes/widgets.php b/wp-includes/widgets.php
    index dc6ce99322..90c5dfefae 100644
    a b function is_active_sidebar( $index ) { 
    930930 * @return array Upgraded list of widgets to version 3 array format when called from the admin.
    931931 */
    932932function wp_get_sidebars_widgets( $deprecated = true ) {
    933         if ( $deprecated !== true ) {
     933        if ( true !== $deprecated ) {
    934934                _deprecated_argument( __FUNCTION__, '2.8.1' );
    935935        }
    936936