wordInflector = $wordInflector; } public function inflect(string $word) : string { return $this->cache[$word] ?? ($this->cache[$word] = $this->wordInflector->inflect($word)); } }