Completed
Pull Request — master (#97)
by Jonathan
02:39
created
lib/Doctrine/Inflector/Rules/Pattern.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
lib/Doctrine/Inflector/Rules/Patterns.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,11 +20,11 @@
 block discarded – undo
20 20
     {
21 21
         $this->patterns = $patterns;
22 22
 
23
-        $patterns = array_map(function (Pattern $word) : string {
23
+        $patterns = array_map(function(Pattern $word) : string {
24 24
             return $word->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
Please login to merge, or discard this patch.
lib/Doctrine/Inflector/Rules/Substitutions.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
             $this->substitutions[$substitution->getFrom()->getWord()] = $substitution;
26 26
         }
27 27
 
28
-        $this->regex = '(?:' . implode('|', array_keys($this->substitutions)) . ')';
28
+        $this->regex = '(?:'.implode('|', array_keys($this->substitutions)).')';
29 29
     }
30 30
 
31 31
     public function getFlippedSubstitutions() : Substitutions
@@ -45,8 +45,8 @@  discard block
 block discarded – undo
45 45
 
46 46
     public function inflect(string $word) : string
47 47
     {
48
-        if (preg_match('/(.*)\\b(' . $this->regex . ')$/i', $word, $regs) === 1) {
49
-            return $regs[1] . $word[0] . substr($this->substitutions[strtolower($regs[2])]->getTo()->getWord(), 1);
48
+        if (preg_match('/(.*)\\b('.$this->regex.')$/i', $word, $regs) === 1) {
49
+            return $regs[1].$word[0].substr($this->substitutions[strtolower($regs[2])]->getTo()->getWord(), 1);
50 50
         }
51 51
 
52 52
         return $word;
Please login to merge, or discard this patch.