50 public function process(
float $count, array $forms ): string {
60 foreach ( $forms as $form ) {
61 if ( str_contains( $form,
'=' ) ) {
65 ] = explode(
'=', $form, 2 );
67 if ( is_numeric( $key ) && (
float)$key === $count ) {
71 $explicitForms[$key] = $text;
74 $defaultForms[] = $form;
79 $pluralType = $this->provider->getPluralProvider()->getPluralRuleType( $count );
83 if ( array_key_exists( $pluralType, $explicitForms ) ) {
84 return $explicitForms[$pluralType];
89 $foundKey = array_search( $pluralType, $defaultForms,
true );
90 if ( $foundKey !==
false ) {
91 return $defaultForms[$foundKey];
96 if ( count( $defaultForms ) > 0 ) {
97 $index = $this->provider->getPluralProvider()->getPluralRuleIndexNumber( $count );
99 $index = min( $index, count( $defaultForms ) - 1 );
101 return $defaultForms[$index];