Completed
Push — develop ( 0e9dd7...101596 )
by Greg
03:03
created
src/Translation.php 1 patch
Switch Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -28,30 +28,30 @@  discard block
 block discarded – undo
28 28
         $this->translations = array();
29 29
 
30 30
         switch (strtolower(pathinfo($filename, PATHINFO_EXTENSION))) {
31
-            case 'csv':
32
-                $fp = fopen($filename, 'r');
33
-                if ($fp) {
34
-                    while (($data = fgetcsv($fp, 0, ';')) !== false) {
35
-                        $this->translations[$data[0]] = $data[1];
36
-                    }
37
-                    fclose($fp);
31
+        case 'csv':
32
+            $fp = fopen($filename, 'r');
33
+            if ($fp) {
34
+                while (($data = fgetcsv($fp, 0, ';')) !== false) {
35
+                    $this->translations[$data[0]] = $data[1];
38 36
                 }
39
-                break;
37
+                fclose($fp);
38
+            }
39
+            break;
40 40
 
41
-            case 'mo':
42
-                $fp = fopen($filename, 'rb');
43
-                if ($fp) {
44
-                    $this->readMoFile($fp);
45
-                    fclose($fp);
46
-                }
47
-                break;
41
+        case 'mo':
42
+            $fp = fopen($filename, 'rb');
43
+            if ($fp) {
44
+                $this->readMoFile($fp);
45
+                fclose($fp);
46
+            }
47
+            break;
48 48
 
49
-            case 'php':
50
-                $translations = include $filename;
51
-                if (is_array($translations)) {
52
-                    $this->translations = $translations;
53
-                }
54
-                break;
49
+        case 'php':
50
+            $translations = include $filename;
51
+            if (is_array($translations)) {
52
+                $this->translations = $translations;
53
+            }
54
+            break;
55 55
         }
56 56
     }
57 57
 
@@ -97,15 +97,15 @@  discard block
 block discarded – undo
97 97
         $magic = $this->readMoWords($fp, 0, 1, self::PACK_LITTLE_ENDIAN);
98 98
 
99 99
         switch (dechex($magic[1])) {
100
-            case self::MO_MAGIC_LITTLE_ENDIAN:
101
-                $pack = self::PACK_LITTLE_ENDIAN;
102
-                break;
103
-            case self::MO_MAGIC_BIG_ENDIAN:
104
-                $pack = self::PACK_BIG_ENDIAN;
105
-                break;
106
-            default:
107
-                // Not a valid .MO file.
108
-                throw new \InvalidArgumentException('Invalid .MO file');
100
+        case self::MO_MAGIC_LITTLE_ENDIAN:
101
+            $pack = self::PACK_LITTLE_ENDIAN;
102
+            break;
103
+        case self::MO_MAGIC_BIG_ENDIAN:
104
+            $pack = self::PACK_BIG_ENDIAN;
105
+            break;
106
+        default:
107
+            // Not a valid .MO file.
108
+            throw new \InvalidArgumentException('Invalid .MO file');
109 109
         }
110 110
 
111 111
         // Read the lookup tables
Please login to merge, or discard this patch.