@@ -21,7 +21,7 @@ |
||
21 | 21 | if ($this->pattern[0] === '/') { |
22 | 22 | $this->regex = $this->pattern; |
23 | 23 | } else { |
24 | - $this->regex = '/' . $this->pattern . '/i'; |
|
24 | + $this->regex = '/'.$this->pattern.'/i'; |
|
25 | 25 | } |
26 | 26 | } |
27 | 27 |
@@ -20,11 +20,11 @@ |
||
20 | 20 | { |
21 | 21 | $this->patterns = $patterns; |
22 | 22 | |
23 | - $patterns = array_map(function (Pattern $pattern) : string { |
|
23 | + $patterns = array_map(function(Pattern $pattern) : string { |
|
24 | 24 | return $pattern->getPattern(); |
25 | 25 | }, $this->patterns); |
26 | 26 | |
27 | - $this->regex = '/^(?:' . implode('|', $patterns) . ')$/i'; |
|
27 | + $this->regex = '/^(?:'.implode('|', $patterns).')$/i'; |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | public function matches(string $word) : bool |
@@ -40,7 +40,7 @@ |
||
40 | 40 | $lowerWord = strtolower($word); |
41 | 41 | |
42 | 42 | if (isset($this->substitutions[$lowerWord])) { |
43 | - return mb_substr($word, 0, 1) . mb_substr($this->substitutions[$lowerWord]->getTo()->getWord(), 1); |
|
43 | + return mb_substr($word, 0, 1).mb_substr($this->substitutions[$lowerWord]->getTo()->getWord(), 1); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | return $word; |