Make WordPress Core

Changeset 55948


Ignore:
Timestamp:
06/20/2023 08:19:51 AM (8 months ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use strict comparison in wp-includes/pomo/translations.php.

Follow-up to [10584], [12079].

Props aristath, poena, afercia, SergeyBiryukov.
See #57839.

File:
1 edited

Legend:

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

    r54133 r55948  
    121121         */
    122122        public function select_plural_form( $count ) {
    123             return 1 == $count ? 0 : 1;
     123            return 1 === (int) $count ? 0 : 1;
    124124        }
    125125
     
    153153                return $translated->translations[ $index ];
    154154            } else {
    155                 return 1 == $count ? $singular : $plural;
     155                return 1 === (int) $count ? $singular : $plural;
    156156            }
    157157        }
     
    367367         */
    368368        public function select_plural_form( $count ) {
    369             return 1 == $count ? 0 : 1;
     369            return 1 === (int) $count ? 0 : 1;
    370370        }
    371371
     
    384384         */
    385385        public function translate_plural( $singular, $plural, $count, $context = null ) {
    386             return 1 == $count ? $singular : $plural;
     386            return 1 === (int) $count ? $singular : $plural;
    387387        }
    388388
Note: See TracChangeset for help on using the changeset viewer.