for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Doctrine\Inflector;
class CacheRulesetInflector implements WordInflector
{
/** @var RulesetInflector */
private $rulesetInflector;
/** @var string[] */
private $cache = [];
public function __construct(RulesetInflector $rulesetInflector)
$this->rulesetInflector = $rulesetInflector;
}
public function inflect(string $word) : string
return $this->cache[$word] ?? $this->cache[$word] = $this->rulesetInflector->inflect($word);