CoreFiles by mySites.guru
Transformations.php29 lines, 648 bytes, from Joomla_6.0.1-Stable-Full_Package.zip
Raw History Compare with 6.0.0
md5
42f1b5ddc6547e3ac6b7e3de9ea0d040
sha1
c0b06f26a29b21ff33bcc81493872771fefcaedc
sha256
1d3f9c4fdb07a4324758fe8a3f04f3996b185fa46840a0b842fbfe4434dbf797
<?php

declare(strict_types=1);

namespace Doctrine\Inflector\Rules;

use Doctrine\Inflector\WordInflector;

class Transformations implements WordInflector
{
    /** @var Transformation[] */
    private $transformations;

    public function __construct(Transformation ...$transformations)
    {
        $this->transformations = $transformations;
    }

    public function inflect(string $word): string
    {
        foreach ($this->transformations as $transformation) {
            if ($transformation->getPattern()->matches($word)) {
                return $transformation->inflect($word);
            }
        }

        return $word;
    }
}

The same content is in 46 releases, Joomla 6.0.0-rc1 to 6.3.0-alpha1. See them all, or every version of this file.