Passed
Push — master ( c57dae...f09347 )
by Luiz Kim
07:37 queued 05:02
created
src/Controller/GetFileDataAction.php 1 patch
Braces   +8 added lines, -6 removed lines patch added patch discarded remove patch
@@ -52,8 +52,9 @@  discard block
 block discarded – undo
52 52
             ]);
53 53
             $file = $data;
54 54
             //$file = $this->manager->getRepository(File::class)->findOneBy(['url' => $request->getPathInfo()]);
55
-            if (!$file)
56
-                throw new \Exception('Not found', 404);
55
+            if (!$file) {
56
+                            throw new \Exception('Not found', 404);
57
+            }
57 58
 
58 59
 
59 60
             $content  = $file->getContent();
@@ -69,10 +70,11 @@  discard block
 block discarded – undo
69 70
                 $response->headers->set('Content-Type', "$fileType/$ext");
70 71
             }
71 72
 
72
-            if ($fileType == 'image')
73
-                $disposition = HeaderUtils::makeDisposition(HeaderUtils::DISPOSITION_INLINE, basename($request->getPathInfo()));
74
-            else
75
-                $disposition = HeaderUtils::makeDisposition(HeaderUtils::DISPOSITION_ATTACHMENT, basename($request->getPathInfo()));
73
+            if ($fileType == 'image') {
74
+                            $disposition = HeaderUtils::makeDisposition(HeaderUtils::DISPOSITION_INLINE, basename($request->getPathInfo()));
75
+            } else {
76
+                            $disposition = HeaderUtils::makeDisposition(HeaderUtils::DISPOSITION_ATTACHMENT, basename($request->getPathInfo()));
77
+            }
76 78
 
77 79
             $response->headers->set('Content-Disposition', $disposition);
78 80
 
Please login to merge, or discard this patch.