Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. SpanishInflector.php

function SpanishInflector::pluralize

Overrides InflectorInterface::pluralize

File

vendor/symfony/string/Inflector/SpanishInflector.php, line 99

Class

SpanishInflector

Namespace

Symfony\Component\String\Inflector

Code

public function pluralize(string $singular) : array {
    if ($this->isInflectedWord($singular)) {
        return [
            $singular,
        ];
    }
    foreach (self::PLURALIZE_REGEXP as $rule) {
        [
            $regexp,
            $replace,
        ] = $rule;
        if (1 === preg_match($regexp, $singular)) {
            return [
                preg_replace($regexp, $replace, $singular),
            ];
        }
    }
    return [
        $singular . 's',
    ];
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal