X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=languages%2FLanguage.php;h=9ed67f96193a8b93b59a5c38a0029ac44f5b9c6c;hp=6b6e88c075c3747cd2014f75a0633cc189414cb0;hb=1715b41651cc23590261e4855ecb2613cfd0861b;hpb=7d129953f6f576c8ee88d792a5905a252c43c62d diff --git a/languages/Language.php b/languages/Language.php index 6b6e88c075..9ed67f9619 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -4023,15 +4023,12 @@ class Language { * Checks that convertPlural was given an array and pads it to requested * amount of forms by copying the last one. * - * @param array $forms Array of forms given to convertPlural + * @param array $forms * @param int $count How many forms should there be at least - * @return array Padded array of forms or an exception if not an array + * @return array Padded array of forms */ protected function preConvertPlural( /* Array */ $forms, $count ) { - while ( count( $forms ) < $count ) { - $forms[] = $forms[count( $forms ) - 1]; - } - return $forms; + return array_pad( $forms, $count, end( $forms ) ); } /**