Skip to content
This repository was archived by the owner on Feb 18, 2023. It is now read-only.

Commit 99e7946

Browse files
committed
[FIX] Fixing code style issues
1 parent c85e313 commit 99e7946

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

app/Http/Controllers/Api/Assets/UploadFileController.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function store(Request $request)
8282
'user' => $request->user(),
8383
]);
8484
} else {
85-
$body = !(base64_decode($request->getContent())) ? $request->getContent() : base64_decode($request->getContent());
85+
$body = ! (base64_decode($request->getContent())) ? $request->getContent() : base64_decode($request->getContent());
8686
$asset = $this->uploadFromDirectFile([
8787
'mime' => $request->header('Content-Type'),
8888
'content' => $body,
@@ -135,7 +135,7 @@ protected function storeInDatabase(array $attributes, $path)
135135
'type' => $this->validMimes[$attributes['mime']]['type'],
136136
'path' => $path,
137137
'mime' => $attributes['mime'],
138-
'user_id' => !empty($attributes['user']) ? $attributes['user']->id : null,
138+
'user_id' => ! empty($attributes['user']) ? $attributes['user']->id : null,
139139
]);
140140

141141
return $file;
@@ -147,7 +147,7 @@ protected function storeInDatabase(array $attributes, $path)
147147
*/
148148
protected function storeInFileSystem(array $attributes)
149149
{
150-
$path = md5(Str::random(16) . date('U')) . '.' . $this->validMimes[$attributes['mime']]['extension'];
150+
$path = md5(Str::random(16).date('U')).'.'.$this->validMimes[$attributes['mime']]['extension'];
151151
Storage::put($path, $attributes['content']);
152152

153153
return $path;
@@ -170,7 +170,7 @@ protected function callFileUrl($url)
170170
return $response;
171171
} catch (TransferException $e) {
172172
throw new StoreResourceFailedException('Validation Error', [
173-
'url' => 'The url seems to be unreachable: ' . $e->getCode(),
173+
'url' => 'The url seems to be unreachable: '.$e->getCode(),
174174
]);
175175
}
176176
}
@@ -180,7 +180,7 @@ protected function callFileUrl($url)
180180
*/
181181
protected function validateMime($mime)
182182
{
183-
if (!array_key_exists($mime, $this->validMimes)) {
183+
if (! array_key_exists($mime, $this->validMimes)) {
184184
throw new StoreResourceFailedException('Validation Error', [
185185
'Content-Type' => 'The Content Type sent is not valid',
186186
]);

0 commit comments

Comments
 (0)