@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | public function addRules(array $rules, bool $reset = false) : void |
46 | 46 | { |
47 | 47 | foreach ($rules as $rule => $pattern) { |
48 | - if (! is_array($pattern)) { |
|
48 | + if (!is_array($pattern)) { |
|
49 | 49 | continue; |
50 | 50 | } |
51 | 51 | |
@@ -57,9 +57,9 @@ discard block |
||
57 | 57 | : $pattern + $this->rules[$rule]; |
58 | 58 | } |
59 | 59 | |
60 | - unset($rules[$rule], $this->rules['cache' . ucfirst($rule)]); |
|
60 | + unset($rules[$rule], $this->rules['cache'.ucfirst($rule)]); |
|
61 | 61 | |
62 | - if (! isset($this->rules['merged'][$rule])) { |
|
62 | + if (!isset($this->rules['merged'][$rule])) { |
|
63 | 63 | continue; |
64 | 64 | } |
65 | 65 | |
@@ -78,13 +78,13 @@ discard block |
||
78 | 78 | return $this->cache[$word]; |
79 | 79 | } |
80 | 80 | |
81 | - if (preg_match('/(.*)\\b(' . $this->rules['cacheIrregular'] . ')$/i', $word, $regs)) { |
|
82 | - $this->cache[$word] = $regs[1] . $word[0] . substr($this->rules['merged']['irregular'][strtolower($regs[2])], 1); |
|
81 | + if (preg_match('/(.*)\\b('.$this->rules['cacheIrregular'].')$/i', $word, $regs)) { |
|
82 | + $this->cache[$word] = $regs[1].$word[0].substr($this->rules['merged']['irregular'][strtolower($regs[2])], 1); |
|
83 | 83 | |
84 | 84 | return $this->cache[$word]; |
85 | 85 | } |
86 | 86 | |
87 | - if (preg_match('/^(' . $this->rules['cacheUninflected'] . ')$/i', $word, $regs)) { |
|
87 | + if (preg_match('/^('.$this->rules['cacheUninflected'].')$/i', $word, $regs)) { |
|
88 | 88 | $this->cache[$word] = $word; |
89 | 89 | |
90 | 90 | return $word; |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | |
106 | 106 | protected function initializeRules() : void |
107 | 107 | { |
108 | - if (! isset($this->rules['merged']['uninflected'])) { |
|
108 | + if (!isset($this->rules['merged']['uninflected'])) { |
|
109 | 109 | $this->rules['merged']['uninflected'] = array_merge( |
110 | 110 | $this->rules['uninflected'], |
111 | 111 | $this->uninflected->getUninflected() |
@@ -118,8 +118,8 @@ discard block |
||
118 | 118 | return; |
119 | 119 | } |
120 | 120 | |
121 | - $this->rules['cacheUninflected'] = '(?:' . implode('|', $this->rules['merged']['uninflected']) . ')'; |
|
122 | - $this->rules['cacheIrregular'] = '(?:' . implode('|', array_keys($this->rules['merged']['irregular'])) . ')'; |
|
121 | + $this->rules['cacheUninflected'] = '(?:'.implode('|', $this->rules['merged']['uninflected']).')'; |
|
122 | + $this->rules['cacheIrregular'] = '(?:'.implode('|', array_keys($this->rules['merged']['irregular'])).')'; |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | abstract protected function initializeIrregular() : void; |