mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-18 16:22:14 +00:00
Fix backend code styling
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -284,12 +284,12 @@ class SetupWizardController extends Controller
|
|||||||
'BACKBLAZE_BUCKET' => $request->storage['bucket'] ?? null,
|
'BACKBLAZE_BUCKET' => $request->storage['bucket'] ?? null,
|
||||||
],
|
],
|
||||||
'oss' => [
|
'oss' => [
|
||||||
'FILESYSTEM_DRIVER' => $request->storage['driver'] ?? null,
|
'FILESYSTEM_DRIVER' => $request->storage['driver'] ?? null,
|
||||||
'OSS_ACCESS_KEY_ID' => $request->storage['key'] ?? null,
|
'OSS_ACCESS_KEY_ID' => $request->storage['key'] ?? null,
|
||||||
'OSS_SECRET_ACCESS_KEY' => $request->storage['secret'] ?? null,
|
'OSS_SECRET_ACCESS_KEY' => $request->storage['secret'] ?? null,
|
||||||
'OSS_ENDPOINT' => $request->storage['endpoint'] ?? null,
|
'OSS_ENDPOINT' => $request->storage['endpoint'] ?? null,
|
||||||
'OSS_REGION' => $request->storage['region'] ?? null,
|
'OSS_REGION' => $request->storage['region'] ?? null,
|
||||||
'OSS_BUCKET' => $request->storage['bucket'] ?? null,
|
'OSS_BUCKET' => $request->storage['bucket'] ?? null,
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ class UploadRequest extends FormRequest
|
|||||||
public function rules()
|
public function rules()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'filename' => 'required|string',
|
'filename' => 'required|string',
|
||||||
'folder_id' => 'nullable|uuid',
|
'folder_id' => 'nullable|uuid',
|
||||||
'file' => ['required', 'file', new DisabledMimetypes],
|
'file' => ['required', 'file', new DisabledMimetypes],
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -139,10 +139,10 @@ function setEnvironmentValue(array $values)
|
|||||||
|
|
||||||
$str = substr($str, 0, -1);
|
$str = substr($str, 0, -1);
|
||||||
|
|
||||||
return !(!file_put_contents($envFile, $str));
|
return ! (! file_put_contents($envFile, $str));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!function_exists('get_invoice_number')) {
|
if (! function_exists('get_invoice_number')) {
|
||||||
/**
|
/**
|
||||||
* Get invoice number
|
* Get invoice number
|
||||||
*
|
*
|
||||||
@@ -156,7 +156,7 @@ if (!function_exists('get_invoice_number')) {
|
|||||||
return now()->year . '001';
|
return now()->year . '001';
|
||||||
}
|
}
|
||||||
|
|
||||||
return (int)$invoices->last()->order + 1;
|
return (int) $invoices->last()->order + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -283,7 +283,7 @@ function is_visitor($shared)
|
|||||||
*/
|
*/
|
||||||
function store_avatar($request, $name)
|
function store_avatar($request, $name)
|
||||||
{
|
{
|
||||||
if (!$request->hasFile($name)) {
|
if (! $request->hasFile($name)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -320,7 +320,7 @@ function store_avatar($request, $name)
|
|||||||
*/
|
*/
|
||||||
function store_system_image($request, $name)
|
function store_system_image($request, $name)
|
||||||
{
|
{
|
||||||
if (!$request->hasFile($name)) {
|
if (! $request->hasFile($name)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -419,7 +419,7 @@ function get_storage_fill_percentage($used, $capacity)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Return in 2 decimal
|
// Return in 2 decimal
|
||||||
return number_format((float)$progress, 2, '.', '');
|
return number_format((float) $progress, 2, '.', '');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -528,7 +528,7 @@ function get_file_type($file_mimetype)
|
|||||||
return 'file';
|
return 'file';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!function_exists('map_language_translations')) {
|
if (! function_exists('map_language_translations')) {
|
||||||
/**
|
/**
|
||||||
* It map language translations as language key and language value
|
* It map language translations as language key and language value
|
||||||
*
|
*
|
||||||
@@ -595,7 +595,7 @@ function get_image_meta_data($file)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!function_exists('get_default_language_translations')) {
|
if (! function_exists('get_default_language_translations')) {
|
||||||
/**
|
/**
|
||||||
* @return Collection
|
* @return Collection
|
||||||
*/
|
*/
|
||||||
@@ -672,7 +672,7 @@ function seems_utf8($str)
|
|||||||
*/
|
*/
|
||||||
function remove_accents($string)
|
function remove_accents($string)
|
||||||
{
|
{
|
||||||
if (!preg_match('/[\x80-\xff]/', $string)) {
|
if (! preg_match('/[\x80-\xff]/', $string)) {
|
||||||
return $string;
|
return $string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -775,7 +775,7 @@ function remove_accents($string)
|
|||||||
// Euro Sign
|
// Euro Sign
|
||||||
chr(226) . chr(130) . chr(172) => 'E',
|
chr(226) . chr(130) . chr(172) => 'E',
|
||||||
// GBP (Pound) Sign
|
// GBP (Pound) Sign
|
||||||
chr(194) . chr(163) => '',];
|
chr(194) . chr(163) => '', ];
|
||||||
|
|
||||||
$string = strtr($string, $chars);
|
$string = strtr($string, $chars);
|
||||||
} else {
|
} else {
|
||||||
@@ -813,7 +813,7 @@ function remove_accents($string)
|
|||||||
function get_files_for_zip($folders, $files, $path = [])
|
function get_files_for_zip($folders, $files, $path = [])
|
||||||
{
|
{
|
||||||
// Return file list
|
// Return file list
|
||||||
if (!isset($folders->folders)) {
|
if (! isset($folders->folders)) {
|
||||||
return $files->unique()->values()->all();
|
return $files->unique()->values()->all();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -859,7 +859,7 @@ function set_time_by_user_timezone($time)
|
|||||||
return Carbon::parse($time);
|
return Carbon::parse($time);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!function_exists('__t')) {
|
if (! function_exists('__t')) {
|
||||||
/**
|
/**
|
||||||
* Translate the given message.
|
* Translate the given message.
|
||||||
* @param $key
|
* @param $key
|
||||||
@@ -880,12 +880,12 @@ if (!function_exists('__t')) {
|
|||||||
|
|
||||||
// Get language strings
|
// Get language strings
|
||||||
$strings = cache()->rememberForever("language-translations-$locale", function () use ($locale) {
|
$strings = cache()->rememberForever("language-translations-$locale", function () use ($locale) {
|
||||||
try {
|
try {
|
||||||
return Language::whereLocale($locale)->firstOrFail()->languageTranslations;
|
return Language::whereLocale($locale)->firstOrFail()->languageTranslations;
|
||||||
} catch (QueryException | ModelNotFoundException $e) {
|
} catch (QueryException | ModelNotFoundException $e) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}) ?? get_default_language_translations();
|
}) ?? get_default_language_translations();
|
||||||
|
|
||||||
// Find the string by key
|
// Find the string by key
|
||||||
$string = $strings->firstWhere('key', $key)->value ?? $strings->get($key);
|
$string = $strings->firstWhere('key', $key)->value ?? $strings->get($key);
|
||||||
@@ -898,7 +898,7 @@ if (!function_exists('__t')) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!function_exists('replace_occurrence')) {
|
if (! function_exists('replace_occurrence')) {
|
||||||
/**
|
/**
|
||||||
* Replace string occurrence in __t() by their values
|
* Replace string occurrence in __t() by their values
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -146,9 +146,9 @@ class FileManagerService
|
|||||||
|
|
||||||
// Store zip record
|
// Store zip record
|
||||||
return Zip::create([
|
return Zip::create([
|
||||||
'user_id' => $shared->user_id ?? Auth::id(),
|
'user_id' => $shared->user_id ?? Auth::id(),
|
||||||
'shared_token' => $shared->token ?? null,
|
'shared_token' => $shared->token ?? null,
|
||||||
'basename' => $zip_name,
|
'basename' => $zip_name,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -163,11 +163,11 @@ class FileManagerService
|
|||||||
{
|
{
|
||||||
return Folder::create([
|
return Folder::create([
|
||||||
'parent_id' => $request->parent_id,
|
'parent_id' => $request->parent_id,
|
||||||
'author' => $shared ? 'visitor' : 'user',
|
'author' => $shared ? 'visitor' : 'user',
|
||||||
'user_id' => $shared ? $shared->user_id : Auth::id(),
|
'user_id' => $shared ? $shared->user_id : Auth::id(),
|
||||||
'name' => $request->name,
|
'name' => $request->name,
|
||||||
'color' => $request->color ?? null,
|
'color' => $request->color ?? null,
|
||||||
'emoji' => $request->emoji ?? null,
|
'emoji' => $request->emoji ?? null,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -398,16 +398,16 @@ class FileManagerService
|
|||||||
|
|
||||||
// Return new file
|
// Return new file
|
||||||
return UserFile::create([
|
return UserFile::create([
|
||||||
'mimetype' => get_file_type_from_mimetype($file_mimetype),
|
'mimetype' => get_file_type_from_mimetype($file_mimetype),
|
||||||
'type' => get_file_type($file_mimetype),
|
'type' => get_file_type($file_mimetype),
|
||||||
'folder_id' => $request->folder_id,
|
'folder_id' => $request->folder_id,
|
||||||
'metadata' => $metadata,
|
'metadata' => $metadata,
|
||||||
'name' => $request->filename,
|
'name' => $request->filename,
|
||||||
'basename' => $disk_file_name,
|
'basename' => $disk_file_name,
|
||||||
'author' => $shared ? 'visitor' : 'user',
|
'author' => $shared ? 'visitor' : 'user',
|
||||||
'thumbnail' => $thumbnail,
|
'thumbnail' => $thumbnail,
|
||||||
'filesize' => $file_size,
|
'filesize' => $file_size,
|
||||||
'user_id' => $user_id,
|
'user_id' => $user_id,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,13 +54,13 @@ return [
|
|||||||
],
|
],
|
||||||
|
|
||||||
'oss' => [
|
'oss' => [
|
||||||
'driver' => 's3',
|
'driver' => 's3',
|
||||||
'key' => env('OSS_ACCESS_KEY_ID'),
|
'key' => env('OSS_ACCESS_KEY_ID'),
|
||||||
'secret' => env('OSS_SECRET_ACCESS_KEY'),
|
'secret' => env('OSS_SECRET_ACCESS_KEY'),
|
||||||
'region' => env('OSS_REGION'),
|
'region' => env('OSS_REGION'),
|
||||||
'bucket' => env('OSS_BUCKET'),
|
'bucket' => env('OSS_BUCKET'),
|
||||||
'endpoint' => env('OSS_ENDPOINT'),
|
'endpoint' => env('OSS_ENDPOINT'),
|
||||||
'url' => env('OSS_URL'),
|
'url' => env('OSS_URL'),
|
||||||
],
|
],
|
||||||
|
|
||||||
's3' => [
|
's3' => [
|
||||||
|
|||||||
Reference in New Issue
Block a user