Completed
Pull Request — master (#63)
by Ron
07:18
created
app/Http/Controllers/FileLinksController.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
         {
43 43
             $hash = strtolower(str_random(15));
44 44
             $dup = FileLinks::where('link_hash', $hash)->get()->count();
45
-        }while($dup != 0);
45
+        } while ($dup != 0);
46 46
         
47 47
         //  Create the new file link
48 48
         $link = FileLinks::create([
@@ -55,10 +55,10 @@  discard block
 block discarded – undo
55 55
         $linkID = $link->link_id;
56 56
         
57 57
         //  If there are any files, process them
58
-        if(!empty($request->file))
58
+        if (!empty($request->file))
59 59
         {
60 60
             $filePath = config('filesystems.paths.links').DIRECTORY_SEPARATOR.$linkID;
61
-            foreach($request->file as $file)
61
+            foreach ($request->file as $file)
62 62
             {
63 63
                 //  Clean the file and store it
64 64
                 $fileName = Files::cleanFilename($filePath, $file->getClientOriginalName());
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
     {
108 108
         $linkData = FileLinks::find($id);
109 109
         
110
-        if(empty($linkData))
110
+        if (empty($linkData))
111 111
         {
112 112
             return view('links.badLink');
113 113
         }
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
     public function getFiles($type, $linkID)
125 125
     {
126 126
         $files = null;
127
-        switch($type)
127
+        switch ($type)
128 128
         {
129 129
             case 'down':
130 130
                 $files = FileLInkFiles::where('link_id', $linkID)
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
     public function submitAddFile($id, Request $request)
161 161
     {
162 162
         $filePath = config('filesystems.paths.links').DIRECTORY_SEPARATOR.$id;
163
-        foreach($request->file as $file)
163
+        foreach ($request->file as $file)
164 164
         {
165 165
             //  Clean the file and store it
166 166
             $fileName = Files::cleanFilename($filePath, $file->getClientOriginalName());
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
         $path = config('filesystems.disks.local.root').DIRECTORY_SEPARATOR;
216 216
         
217 217
         $zip = Zip::create($path.'download.zip');
218
-        foreach($files as $file)
218
+        foreach ($files as $file)
219 219
         {
220 220
             $zip->add($path.$file->file_link.$file->file_name);
221 221
         }
@@ -257,9 +257,9 @@  discard block
 block discarded – undo
257 257
     {
258 258
         //  Remove the file from database
259 259
         $data = FileLinkFiles::where('link_id', $id)->get();
260
-        if(!$data->isEmpty())
260
+        if (!$data->isEmpty())
261 261
         {
262
-            foreach($data as $file)
262
+            foreach ($data as $file)
263 263
             {
264 264
                 $fileID = $file->file_id;
265 265
                 $file->delete();
Please login to merge, or discard this patch.
app/Http/Controllers/UserLinksController.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -27,12 +27,12 @@  discard block
 block discarded – undo
27 27
         $details = FileLinks::where('link_hash', $id)->first();
28 28
         
29 29
         //  Verify that the link is valid
30
-        if(empty($details))
30
+        if (empty($details))
31 31
         {
32 32
             return view('links.guest.badLink');
33 33
         }
34 34
         //  Verify that the link has not expired
35
-        else if($details->expire <= date('Y-m-d'))
35
+        else if ($details->expire<=date('Y-m-d'))
36 36
         {
37 37
             return view('links.guest.expiredLink');
38 38
         }
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
         $details = FileLinks::where('link_hash', $hash)->first();
57 57
         
58 58
         //  Verify that the link is valid
59
-        if(empty($details))
59
+        if (empty($details))
60 60
         {
61 61
             return abort(404);
62 62
         }
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
         $path = config('filesystems.disks.local.root').DIRECTORY_SEPARATOR;
70 70
         
71 71
         $zip = Zip::create($path.'download.zip');
72
-        foreach($files as $file)
72
+        foreach ($files as $file)
73 73
         {
74 74
             $zip->add($path.$file->file_link.$file->file_name);
75 75
         }
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
         
88 88
         $filePath = config('filesystems.paths.links').DIRECTORY_SEPARATOR.$details->link_id;
89 89
 
90
-        foreach($request->file as $file)
90
+        foreach ($request->file as $file)
91 91
         {
92 92
             //  Clean the file and store it
93 93
             $fileName = Files::cleanFilename($filePath, $file->getClientOriginalName());
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
                 'upload'   => 1
109 109
             ]);
110 110
             
111
-            if(!empty($request->note))
111
+            if (!empty($request->note))
112 112
             {
113 113
                 FileLinkNotes::create([
114 114
                     'link_id' => $details->link_id,
Please login to merge, or discard this patch.