Skip to content

Commit e014ef0

Browse files
committed
CI fix
1 parent 81ffd69 commit e014ef0

File tree

2 files changed

+21
-18
lines changed

2 files changed

+21
-18
lines changed

src/MediaController.php

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
namespace Encore\Admin\Media;
34

45
use Encore\Admin\Facades\Admin;
@@ -11,19 +12,19 @@ class MediaController extends Controller
1112
public function index(Request $request)
1213
{
1314
return Admin::content(function (Content $content) use ($request) {
14-
$content->header('Media manager');
15+
$content->header('Media manager');
1516

16-
$path = $request->get('path', '/');
17-
$view = $request->get('view', 'table');
17+
$path = $request->get('path', '/');
18+
$view = $request->get('view', 'table');
1819

19-
$manager = new MediaManager($path);
20+
$manager = new MediaManager($path);
2021

21-
$content->body(view("laravel-admin-media::$view", [
22+
$content->body(view("laravel-admin-media::$view", [
2223
'list' => $manager->ls(),
2324
'nav' => $manager->navigation(),
2425
'url' => $manager->urls(),
25-
]));
26-
});
26+
]));
27+
});
2728
}
2829

2930
public function download(Request $request)
@@ -36,7 +37,7 @@ public function download(Request $request)
3637
return $manager->download();
3738
} catch (\Exception $e) {
3839
return response()->json([
39-
'status' => false,
40+
'status' => false,
4041
'message' => $e->getMessage(),
4142
]);
4243
}
@@ -69,14 +70,14 @@ public function delete(Request $request)
6970
try {
7071
if ($manager->delete($files)) {
7172
return response()->json([
72-
'status' => true,
73-
'message' => trans('admin.delete_succeeded'),
73+
'status' => true,
74+
'message' => trans('admin.delete_succeeded'),
7475
]);
7576
}
7677
} catch (\Exception $e) {
7778
return response()->json([
78-
'status' => false,
79-
'message' => $e->getMessage(),
79+
'status' => false,
80+
'message' => $e->getMessage(),
8081
]);
8182
}
8283
}
@@ -91,14 +92,14 @@ public function move(Request $request)
9192
try {
9293
if ($manager->move($new)) {
9394
return response()->json([
94-
'status' => true,
95-
'message' => trans('admin.move_succeeded'),
95+
'status' => true,
96+
'message' => trans('admin.move_succeeded'),
9697
]);
9798
}
9899
} catch (\Exception $e) {
99100
return response()->json([
100-
'status' => false,
101-
'message' => $e->getMessage(),
101+
'status' => false,
102+
'message' => $e->getMessage(),
102103
]);
103104
}
104105
}

src/MediaManager.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ class MediaManager extends Extension
2828

2929
/**
3030
* List of allowed extensions.
31+
*
3132
* @var string
3233
*/
3334
protected $allowed = [];
@@ -106,6 +107,7 @@ protected function getFullPath($path)
106107
if (strstr($fullPath, '..')) {
107108
throw new \Exception('Incorrect path');
108109
}
110+
109111
return $path;
110112
}
111113

@@ -141,7 +143,7 @@ public function move($new)
141143
{
142144
$ext = pathinfo($new, PATHINFO_EXTENSION);
143145
if ($this->allowed && !in_array($ext, $this->allowed)) {
144-
throw new \Exception('File extension ' . $ext . ' is not allowed');
146+
throw new \Exception('File extension '.$ext.' is not allowed');
145147
}
146148

147149
return $this->storage->move($this->path, $new);
@@ -157,7 +159,7 @@ public function upload($files = [])
157159
{
158160
foreach ($files as $file) {
159161
if ($this->allowed && !in_array($file->getClientOriginalExtension(), $this->allowed)) {
160-
throw new \Exception('File extension ' . $file->getClientOriginalExtension() . ' is not allowed');
162+
throw new \Exception('File extension '.$file->getClientOriginalExtension().' is not allowed');
161163
}
162164

163165
$this->storage->putFileAs($this->path, $file, $file->getClientOriginalName());

0 commit comments

Comments
 (0)