Passed
Push — main ( 8fa9e1...957ef0 )
by Thierry
06:37
created
jaxon-upload/src/Manager/UploadManager.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -121,13 +121,13 @@  discard block
 block discarded – undo
121 121
         try
122 122
         {
123 123
             $xFilesystem->createDirectory($sUploadDir);
124
-            if(!$xFilesystem->directoryExists($sUploadDir))
124
+            if (!$xFilesystem->directoryExists($sUploadDir))
125 125
             {
126 126
                 throw new RequestException($this->xTranslator->trans('errors.upload.access'));
127 127
             }
128 128
             return $sUploadDir;
129 129
         }
130
-        catch(FilesystemException $e)
130
+        catch (FilesystemException $e)
131 131
         {
132 132
             $this->xLogger->error('Filesystem error.', ['message' => $e->getMessage()]);
133 133
             throw new RequestException($this->xTranslator->trans('errors.upload.access'));
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
     {
163 163
         // Check the uploaded file validity
164 164
         $nErrorCode = $xHttpFile->getError();
165
-        if($nErrorCode !== UPLOAD_ERR_OK)
165
+        if ($nErrorCode !== UPLOAD_ERR_OK)
166 166
         {
167 167
             $this->xLogger->error('File upload error.', [
168 168
                 'code' => $nErrorCode,
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
 
177 177
         // Filename without the extension. Needs to be sanitized.
178 178
         $sName = pathinfo($xHttpFile->getClientFilename(), PATHINFO_FILENAME);
179
-        if($this->cNameSanitizer !== null)
179
+        if ($this->cNameSanitizer !== null)
180 180
         {
181 181
             $sName = (string)call_user_func($this->cNameSanitizer,
182 182
                 $sName, $sField, $this->sUploadFieldId);
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
         // Set the user file data
186 186
         $xFile = File::fromHttpFile($this->xFileStorage->filesystem($sField), $xHttpFile, $sUploadDir, $sName);
187 187
         // Verify file validity (format, size)
188
-        if(!$this->xValidator->validateUploadedFile($sField, $xFile))
188
+        if (!$this->xValidator->validateUploadedFile($sField, $xFile))
189 189
         {
190 190
             throw new RequestException($this->xValidator->getErrorMessage());
191 191
         }
@@ -209,16 +209,16 @@  discard block
 block discarded – undo
209 209
 
210 210
         $aUserFiles = [];
211 211
         $aAllFiles = []; // A flat list of all uploaded files
212
-        foreach($aTempFiles as $sField => $aFiles)
212
+        foreach ($aTempFiles as $sField => $aFiles)
213 213
         {
214 214
             $aUserFiles[$sField] = [];
215 215
             // Get the path to the upload dir
216 216
             $sUploadDir = $this->getUploadDir($sField);
217
-            if(!is_array($aFiles))
217
+            if (!is_array($aFiles))
218 218
             {
219 219
                 $aFiles = [$aFiles];
220 220
             }
221
-            foreach($aFiles as $xHttpFile)
221
+            foreach ($aFiles as $xHttpFile)
222 222
             {
223 223
                 $aFile = $this->makeUploadedFile($xHttpFile, $sUploadDir, $sField);
224 224
                 $aUserFiles[$sField][] = $aFile['user'];
@@ -229,14 +229,14 @@  discard block
 block discarded – undo
229 229
         // Copy the uploaded files from the temp dir to the user dir
230 230
         try
231 231
         {
232
-            foreach($aAllFiles as $aFiles)
232
+            foreach ($aAllFiles as $aFiles)
233 233
             {
234 234
                 $sPath = $aFiles['user']->path();
235 235
                 $xContent = $aFiles['temp']->getStream();
236 236
                 $aFiles['user']->filesystem()->write($sPath, $xContent);
237 237
             }
238 238
         }
239
-        catch(FilesystemException $e)
239
+        catch (FilesystemException $e)
240 240
         {
241 241
             $this->xLogger->error('Filesystem error.', ['message' => $e->getMessage()]);
242 242
             throw new RequestException($this->xTranslator->trans('errors.upload.access'));
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -126,8 +126,7 @@  discard block
 block discarded – undo
126 126
                 throw new RequestException($this->xTranslator->trans('errors.upload.access'));
127 127
             }
128 128
             return $sUploadDir;
129
-        }
130
-        catch(FilesystemException $e)
129
+        } catch(FilesystemException $e)
131 130
         {
132 131
             $this->xLogger->error('Filesystem error.', ['message' => $e->getMessage()]);
133 132
             throw new RequestException($this->xTranslator->trans('errors.upload.access'));
@@ -235,8 +234,7 @@  discard block
 block discarded – undo
235 234
                 $xContent = $aFiles['temp']->getStream();
236 235
                 $aFiles['user']->filesystem()->write($sPath, $xContent);
237 236
             }
238
-        }
239
-        catch(FilesystemException $e)
237
+        } catch(FilesystemException $e)
240 238
         {
241 239
             $this->xLogger->error('Filesystem error.', ['message' => $e->getMessage()]);
242 240
             throw new RequestException($this->xTranslator->trans('errors.upload.access'));
Please login to merge, or discard this patch.
jaxon-annotations/tests/Attr/Ajax/CallbackError.php 1 patch
Switch Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -6,38 +6,38 @@
 block discarded – undo
6 6
 
7 7
 class CallbackError extends FuncComponent
8 8
 {
9
-    /**
9
+/**
10 10
      * @callback
11 11
      */
12
-    public function noName()
13
-    {
14
-    }
12
+public function noName()
13
+{
14
+}
15 15
 
16
-    /**
16
+/**
17 17
      * @callback('name' => [])
18 18
      */
19
-    public function wrongNameType()
20
-    {
21
-    }
19
+public function wrongNameType()
20
+{
21
+}
22 22
 
23
-    /**
23
+/**
24 24
      * @callback('class' => 'jaxon.ajax.callback.test')
25 25
      */
26
-    public function wrongNameAttr()
27
-    {
28
-    }
26
+public function wrongNameAttr()
27
+{
28
+}
29 29
 
30
-    /**
30
+/**
31 31
      * @callback('name' => 'jaxon.ajax callback.test')
32 32
      */
33
-    public function nameWithSpace()
34
-    {
35
-    }
33
+public function nameWithSpace()
34
+{
35
+}
36 36
 
37
-    /**
37
+/**
38 38
      * @callback('class' => '12jaxon.ajax.callback.test')
39 39
      */
40
-    public function startWithInt()
41
-    {
42
-    }
40
+public function startWithInt()
41
+{
42
+}
43 43
 }
Please login to merge, or discard this patch.
jaxon-annotations/tests/Attr/Ajax/ContainerError.php 1 patch
Switch Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,9 +6,9 @@
 block discarded – undo
6 6
 
7 7
 class ContainerError extends FuncComponent
8 8
 {
9
-    /**
9
+/**
10 10
      * @di('class' => 'Class1')
11 11
      * @di('class' => 'Class2')
12 12
      */
13
-    public $prop;
13
+public $prop;
14 14
 }
Please login to merge, or discard this patch.