[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

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

   1  <?php
   2  
   3  declare(strict_types=1);
   4  
   5  namespace Doctrine\Inflector;
   6  
   7  class CachedWordInflector implements WordInflector
   8  {
   9      /** @var WordInflector */
  10      private $wordInflector;
  11  
  12      /** @var string[] */
  13      private $cache = [];
  14  
  15      public function __construct(WordInflector $wordInflector)
  16      {
  17          $this->wordInflector = $wordInflector;
  18      }
  19  
  20      public function inflect(string $word): string
  21      {
  22          return $this->cache[$word] ?? $this->cache[$word] = $this->wordInflector->inflect($word);
  23      }
  24  }


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