Passed
Pull Request — master (#49)
by
unknown
08:58
created
src/Vin.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
         // The given VIN must be in upper case...
92 92
         $value = strtoupper($value);
93 93
 
94
-        if (! preg_match(self::REGEX, $value, $match)) {
94
+        if (!preg_match(self::REGEX, $value, $match)) {
95 95
             throw new InvalidArgumentException(
96 96
                 sprintf('The value "%s" is not a valid VIN', $value)
97 97
             );
@@ -99,9 +99,9 @@  discard block
 block discarded – undo
99 99
 
100 100
         // Base values
101 101
         $this->vin = $value;
102
-        $this->wmi = $match['wmi'];
103
-        $this->vds = $match['vds'];
104
-        $this->vis = $match['vis'];
102
+        $this->wmi = $match[ 'wmi' ];
103
+        $this->vds = $match[ 'vds' ];
104
+        $this->vis = $match[ 'vis' ];
105 105
 
106 106
         // Parsed values
107 107
         $this->region = $this->identifyRegion();
@@ -197,11 +197,11 @@  discard block
 block discarded – undo
197 197
     private function identifyRegion() : ?string
198 198
     {
199 199
         // undefined region...
200
-        if (! isset(REGIONS[$this->wmi[0]])) {
200
+        if (!isset(REGIONS[ $this->wmi[ 0 ] ])) {
201 201
             return null;
202 202
         }
203 203
 
204
-        return REGIONS[$this->wmi[0]]['region'] ?? null;
204
+        return REGIONS[ $this->wmi[ 0 ] ][ 'region' ] ?? null;
205 205
     }
206 206
 
207 207
     /**
@@ -210,12 +210,12 @@  discard block
 block discarded – undo
210 210
     private function identifyCountry() : ?string
211 211
     {
212 212
         // undefined region...
213
-        if (! isset(REGIONS[$this->wmi[0]])) {
213
+        if (!isset(REGIONS[ $this->wmi[ 0 ] ])) {
214 214
             return null;
215 215
         }
216 216
 
217
-        foreach (REGIONS[$this->wmi[0]]['countries'] as $chars => $title) {
218
-            if (! (false === strpbrk($this->wmi[1], $chars))) {
217
+        foreach (REGIONS[ $this->wmi[ 0 ] ][ 'countries' ] as $chars => $title) {
218
+            if (!(false === strpbrk($this->wmi[ 1 ], $chars))) {
219 219
                 return $title;
220 220
             }
221 221
         }
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
      */
229 229
     private function identifyManufacturer() : ?string
230 230
     {
231
-        return MANUFACTURERS[$this->wmi] ?? MANUFACTURERS[$this->wmi[0] . $this->wmi[1]] ?? null;
231
+        return MANUFACTURERS[ $this->wmi ] ?? MANUFACTURERS[ $this->wmi[ 0 ].$this->wmi[ 1 ] ] ?? null;
232 232
     }
233 233
 
234 234
     /**
@@ -237,11 +237,11 @@  discard block
 block discarded – undo
237 237
     private function identifyModelYear() : array
238 238
     {
239 239
         $comingYear = (int) date('Y') + 1;
240
-        $certainYears = [];
240
+        $certainYears = [ ];
241 241
 
242 242
         foreach (YEARS as $year => $char) {
243
-            if ($this->vis[0] === $char) {
244
-                $certainYears[] = $year;
243
+            if ($this->vis[ 0 ] === $char) {
244
+                $certainYears[ ] = $year;
245 245
             }
246 246
 
247 247
             if ($comingYear === $year) {
Please login to merge, or discard this patch.