Passed
Pull Request — master (#97)
by Jonathan
02:18
created
lib/Doctrine/Inflector/Rules/Irregular.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -47,8 +47,8 @@  discard block
 block discarded – undo
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->substitutions[strtolower($regs[2])]->getTo()->getWord(), 1);
50
+        if (preg_match('/(.*)\\b('.$this->getRegex().')$/i', $word, $regs) > 0) {
51
+            return $regs[1].$word[0].substr($this->substitutions[strtolower($regs[2])]->getTo()->getWord(), 1);
52 52
         }
53 53
 
54 54
         return $word;
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
     private function getRegex() : string
58 58
     {
59 59
         if ($this->regex === null) {
60
-            $this->regex = '(?:' . implode('|', array_keys($this->substitutions)) . ')';
60
+            $this->regex = '(?:'.implode('|', array_keys($this->substitutions)).')';
61 61
         }
62 62
 
63 63
         return $this->regex;
Please login to merge, or discard this patch.
lib/Doctrine/Inflector/SingularizerFactory.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -60,12 +60,12 @@
 block discarded – undo
60 60
         $irregular       = $this->irregular ?? new Irregular(...Singular::getIrregular());
61 61
         $pluralIrregular = $this->pluralIrregular ?? new Irregular(...Plural::getIrregular());
62 62
 
63
-        $singularUninflected = new Uninflected(...(static function () use ($uninflected) : iterable {
63
+        $singularUninflected = new Uninflected(...(static function() use ($uninflected) : iterable {
64 64
             yield from $uninflected->getPatterns();
65 65
             yield from Uninflected::getDefault();
66 66
         })());
67 67
 
68
-        $singularIrregular = new Irregular(...(static function () use ($irregular, $pluralIrregular) : iterable {
68
+        $singularIrregular = new Irregular(...(static function() use ($irregular, $pluralIrregular) : iterable {
69 69
             yield from $irregular->getSubstitutions();
70 70
             yield from $pluralIrregular->getFlippedSubstitutions();
71 71
         })());
Please login to merge, or discard this patch.
lib/Doctrine/Inflector/Rules/Uninflected.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -150,11 +150,11 @@
 block discarded – undo
150 150
     private function getRegex() : string
151 151
     {
152 152
         if ($this->regex === null) {
153
-            $patterns = array_map(function (Pattern $word) : string {
153
+            $patterns = array_map(function(Pattern $word) : string {
154 154
                 return $word->getPattern();
155 155
             }, $this->patterns);
156 156
 
157
-            $this->regex = '/^(?:' . implode('|', $patterns) . ')$/i';
157
+            $this->regex = '/^(?:'.implode('|', $patterns).')$/i';
158 158
         }
159 159
 
160 160
         return $this->regex;
Please login to merge, or discard this patch.
lib/Doctrine/Inflector/Rules/Pattern.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
             return $this->pattern;
28 28
         }
29 29
 
30
-        return '/' . $this->pattern . '/i';
30
+        return '/'.$this->pattern.'/i';
31 31
     }
32 32
 
33 33
     public function matches(string $word) : bool
Please login to merge, or discard this patch.
lib/Doctrine/Inflector/PluralizerFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
         $uninflected     = $this->uninflected ?? new Uninflected(...Plural::getUninflected());
49 49
         $irregular       = $this->irregular ?? new Irregular(...Plural::getIrregular());
50 50
 
51
-        $pluralUninflected = new Uninflected(...(static function () use ($uninflected) : iterable {
51
+        $pluralUninflected = new Uninflected(...(static function() use ($uninflected) : iterable {
52 52
             yield from $uninflected->getPatterns();
53 53
             yield from Uninflected::getDefault();
54 54
         })());
Please login to merge, or discard this patch.