[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/ -> Transformations.php (source)

   1  <?php
   2  
   3  declare(strict_types=1);
   4  
   5  namespace Doctrine\Inflector\Rules;
   6  
   7  use Doctrine\Inflector\WordInflector;
   8  
   9  class Transformations implements WordInflector
  10  {
  11      /** @var Transformation[] */
  12      private $transformations;
  13  
  14      public function __construct(Transformation ...$transformations)
  15      {
  16          $this->transformations = $transformations;
  17      }
  18  
  19      public function inflect(string $word): string
  20      {
  21          foreach ($this->transformations as $transformation) {
  22              if ($transformation->getPattern()->matches($word)) {
  23                  return $transformation->inflect($word);
  24              }
  25          }
  26  
  27          return $word;
  28      }
  29  }


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer