diff --git a/src/Translator.php b/src/Translator.php index 83b9fa8..fa838ba 100644 --- a/src/Translator.php +++ b/src/Translator.php @@ -120,9 +120,9 @@ public function __construct(string $filename) try { $magic = $stream->read(0, 4); - if (strcmp($magic, self::MAGIC_LE) == 0) { + if (strcmp($magic, self::MAGIC_LE) === 0) { $unpack = 'V'; - } elseif (strcmp($magic, self::MAGIC_BE) == 0) { + } elseif (strcmp($magic, self::MAGIC_BE) === 0) { $unpack = 'N'; } else { $this->error = self::ERROR_BAD_MAGIC; @@ -225,11 +225,11 @@ public static function extractPluralCount($expr) { $parts = explode(';', $expr, 2); $nplurals = explode('=', trim($parts[0]), 2); - if (strtolower(rtrim($nplurals[0])) != 'nplurals') { + if (strtolower(rtrim($nplurals[0])) !== 'nplurals') { return 1; } - if (count($nplurals) == 1) { + if (count($nplurals) === 1) { return 1; } @@ -327,7 +327,7 @@ public function ngettext($msgid, $msgidPlural, $number) // this should contains all strings separated by NULLs $key = implode(chr(0), [$msgid, $msgidPlural]); if (! array_key_exists($key, $this->cacheTranslations)) { - return ($number != 1) ? $msgidPlural : $msgid; + return ($number !== 1) ? $msgidPlural : $msgid; } // find out the appropriate form