@@ -47,8 +47,8 @@ discard block |
||
47 | 47 | |
48 | 48 | public function inflect(string $word) : string |
49 | 49 | { |
50 | - if (preg_match('/(.*)\\b(' . $this->getRegex() . ')$/i', $word, $regs) > 0) { |
|
51 | - return $regs[1] . $word[0] . substr($this->rules[strtolower($regs[2])]->getTo(), 1); |
|
50 | + if (preg_match('/(.*)\\b('.$this->getRegex().')$/i', $word, $regs) > 0) { |
|
51 | + return $regs[1].$word[0].substr($this->rules[strtolower($regs[2])]->getTo(), 1); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | return $word; |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | private function getRegex() : string |
58 | 58 | { |
59 | 59 | if ($this->regex === null) { |
60 | - $this->regex = '(?:' . implode('|', array_keys($this->rules)) . ')'; |
|
60 | + $this->regex = '(?:'.implode('|', array_keys($this->rules)).')'; |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | return $this->regex; |