Issue #3484349 by amateescu: Add missing @return types for StringTranslationTrait::formatPlural() and ::getNumberOfPlurals()

(cherry picked from commit bbfe778cb0)
merge-requests/10256/head
catch 2024-11-18 15:29:45 +00:00
parent c9820e0e61
commit 8d08c0a6ca
2 changed files with 6 additions and 2328 deletions

File diff suppressed because it is too large Load Diff

View File

@ -75,6 +75,9 @@ trait StringTranslationTrait {
* Formats a string containing a count of items.
*
* @see \Drupal\Core\StringTranslation\TranslationInterface::formatPlural()
*
* @return \Drupal\Core\StringTranslation\PluralTranslatableMarkup
* An object that, when cast to a string, returns the translated string.
*/
protected function formatPlural($count, $singular, $plural, array $args = [], array $options = []) {
return new PluralTranslatableMarkup($count, $singular, $plural, $args, $options, $this->getStringTranslation());
@ -84,6 +87,9 @@ trait StringTranslationTrait {
* Returns the number of plurals supported by a given language.
*
* @see \Drupal\locale\PluralFormulaInterface::getNumberOfPlurals()
*
* @return int
* The number of plurals supported.
*/
protected function getNumberOfPlurals($langcode = NULL) {
if (\Drupal::hasService('locale.plural.formula')) {