54 public function process(
float $count, array $forms ): string {
64 foreach ( $forms as $form ) {
65 if ( str_contains( $form,
'=' ) ) {
69 ] = explode(
'=', $form, 2 );
71 if ( is_numeric( $key ) && (
float)$key === $count ) {
75 $explicitForms[$key] = $text;
78 $defaultForms[] = $form;
83 $pluralType = $this->provider->getPluralProvider()->getPluralRuleType( $count );
87 if ( array_key_exists( $pluralType, $explicitForms ) ) {
88 return $explicitForms[$pluralType];
93 $foundKey = array_search( $pluralType, $defaultForms,
true );
94 if ( $foundKey !==
false ) {
95 return $defaultForms[$foundKey];
100 if ( count( $defaultForms ) > 0 ) {
101 $index = $this->provider->getPluralProvider()->getPluralRuleIndexNumber( $count );
103 $index = min( $index, count( $defaultForms ) - 1 );
105 return $defaultForms[$index];