Failed Conditions
Pull Request — master (#97)
by Jonathan
02:23
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)) {
51
-            return $regs[1] . $word[0] . substr($this->rules[strtolower($regs[2])]->getTo(), 1);
50
+        if (preg_match('/(.*)\\b('.$this->getRegex().')$/i', $word, $regs)) {
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
lib/Doctrine/Inflector/Rules/Uninflected.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -144,17 +144,17 @@
 block discarded – undo
144 144
 
145 145
     public function isUninflected(string $word) : bool
146 146
     {
147
-        return preg_match('/^(' . $this->getRegex() . ')$/i', $word, $regs) === 1;
147
+        return preg_match('/^('.$this->getRegex().')$/i', $word, $regs) === 1;
148 148
     }
149 149
 
150 150
     private function getRegex() : string
151 151
     {
152 152
         if ($this->regex === null) {
153
-            $words = array_map(function (Word $word) : string {
153
+            $words = array_map(function(Word $word) : string {
154 154
                 return $word->getWord();
155 155
             }, $this->words);
156 156
 
157
-            $this->regex = '(?:' . implode('|', $words) . ')';
157
+            $this->regex = '(?:'.implode('|', $words).')';
158 158
         }
159 159
 
160 160
         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::getIrregularRules());
61 61
         $pluralIrregular = $this->pluralIrregular ?? new Irregular(...Plural::getIrregularRules());
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->getWords();
65 65
             yield from Uninflected::getDefaultWords();
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->getRules();
70 70
             yield from $pluralIrregular->getFlippedRules();
71 71
         })());
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::getUninflectedWords());
49 49
         $irregular   = $this->irregular ?? new Irregular(...Plural::getIrregularRules());
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->getWords();
53 53
             yield from Uninflected::getDefaultWords();
54 54
         })());
Please login to merge, or discard this patch.