Passed
Pull Request — master (#29)
by
unknown
04:17
created
src/MimeUploadValidator.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -113,8 +113,8 @@  discard block
 block discarded – undo
113 113
         if (isset($knownMimes[$extension])) {
114 114
           $mimes = (array) $knownMimes[$extension];
115 115
 
116
-          foreach($mimes as $mime){
117
-              if (!in_array($mime,$expectedMimes)) {
116
+          foreach ($mimes as $mime) {
117
+              if (!in_array($mime, $expectedMimes)) {
118 118
                   $expectedMimes[] = $mime;
119 119
               }
120 120
           }
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 
155 155
             if ($result === false) {
156 156
                 $this->errors[] = _t(
157
-                    __CLASS__ . '.INVALIDMIME',
157
+                    __CLASS__.'.INVALIDMIME',
158 158
                     'File extension does not match known MIME type'
159 159
                 );
160 160
 
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
             }
163 163
         } catch (MimeUploadValidator_Exception $e) {
164 164
             $this->errors[] = _t(
165
-                __CLASS__ . '.FAILEDMIMECHECK',
165
+                __CLASS__.'.FAILEDMIMECHECK',
166 166
                 'MIME validation failed: {message}',
167 167
                 'Argument 1: Message about why MIME type detection failed',
168 168
                 ['message' => $e->getMessage()]
Please login to merge, or discard this patch.
tests/MimeUploadValidatorTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
     {
17 17
         // setup plaintext file with invalid extension
18 18
         $tmpFileName = 'UploadTest-testUpload.jpg';
19
-        $tmpFilePath = TEMP_FOLDER . '/' . $tmpFileName;
19
+        $tmpFilePath = TEMP_FOLDER.'/'.$tmpFileName;
20 20
         $tmpFileContent = '';
21 21
 
22 22
         for ($i = 0; $i < 10000; $i++) {
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
     {
50 50
         // Setup a file with a capitalised extension and try to match it against a lowercase file.
51 51
         $tmpFileName = 'text.TXT';
52
-        $tmpFilePath = TEMP_FOLDER . '/' . $tmpFileName;
52
+        $tmpFilePath = TEMP_FOLDER.'/'.$tmpFileName;
53 53
         $tmpFileContent = '';
54 54
 
55 55
         for ($i = 0; $i < 10000; $i++) {
Please login to merge, or discard this patch.