| Total Complexity | 6 |
| Total Lines | 53 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | abstract class InflectorService |
||
| 11 | { |
||
| 12 | /** @var mixed[] */ |
||
| 13 | protected $rules = []; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * Method cache array. |
||
| 17 | * |
||
| 18 | * @var string[][] |
||
| 19 | */ |
||
| 20 | protected $cache = []; |
||
| 21 | |||
| 22 | public function __construct() |
||
| 23 | { |
||
| 24 | $this->rules = $this->getRules(); |
||
| 25 | } |
||
| 26 | |||
| 27 | abstract public function inflect(string $word) : string; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @return string[][] |
||
| 31 | */ |
||
| 32 | abstract public function getRules() : array; |
||
| 33 | |||
| 34 | public function reset() : void |
||
| 35 | { |
||
| 36 | $this->cache = []; |
||
| 37 | $this->rules = $this->getRules(); |
||
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * @param mixed[] $rules |
||
| 42 | */ |
||
| 43 | public function addRules(array $rules, bool $reset = false) : void |
||
| 63 | } |
||
| 64 | } |
||
| 65 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.