Update Inflector::ordinalize() (#3759)

put the init() call before the $ordinals test
This commit is contained in:
Jeff
2023-10-24 05:19:24 -04:00
committed by GitHub
parent c66da5bedb
commit f0f29891d6

View File

@@ -310,12 +310,12 @@ class Inflector
*/
public static function ordinalize($number)
{
static::init();
if (!is_array(static::$ordinals)) {
return (string)$number;
}
static::init();
if (in_array($number % 100, range(11, 13), true)) {
return $number . static::$ordinals['default'];
}