Fix backend code styling

This commit is contained in:
MakingCG
2021-07-09 10:05:40 +00:00
committed by GitHub Actions
parent 82019f4833
commit e7cfa07392
2 changed files with 153 additions and 154 deletions

File diff suppressed because one or more lines are too long

View File

@@ -16,7 +16,7 @@ use Illuminate\Support\Facades\Storage;
use Intervention\Image\ImageManagerStatic as Image; use Intervention\Image\ImageManagerStatic as Image;
use Illuminate\Database\Eloquent\ModelNotFoundException; use Illuminate\Database\Eloquent\ModelNotFoundException;
if (!function_exists('obfuscate_email')) { if (! function_exists('obfuscate_email')) {
/** /**
* Obfuscate email * Obfuscate email
* *
@@ -33,7 +33,7 @@ if (!function_exists('obfuscate_email')) {
} }
} }
if (!function_exists('get_setting')) { if (! function_exists('get_setting')) {
/** /**
* Get single value from settings table * Get single value from settings table
* *
@@ -46,7 +46,7 @@ if (!function_exists('get_setting')) {
} }
} }
if (!function_exists('get_settings_in_json')) { if (! function_exists('get_settings_in_json')) {
/** /**
* Get all app settings and return them as json * Get all app settings and return them as json
*/ */
@@ -60,7 +60,7 @@ if (!function_exists('get_settings_in_json')) {
} }
} }
if (!function_exists('get_setup_status')) { if (! function_exists('get_setup_status')) {
/** /**
* Check if setup wizard was passed * Check if setup wizard was passed
* *
@@ -74,7 +74,7 @@ if (!function_exists('get_setup_status')) {
} }
} }
if (!function_exists('add_paragraphs')) { if (! function_exists('add_paragraphs')) {
/** /**
* Create paragraph from text * Create paragraph from text
* *
@@ -123,7 +123,7 @@ if (!function_exists('add_paragraphs')) {
} }
} }
if (!function_exists('setEnvironmentValue')) { if (! function_exists('setEnvironmentValue')) {
/** /**
* Set environment value * Set environment value
* *
@@ -150,11 +150,11 @@ if (!function_exists('setEnvironmentValue')) {
$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
* *
@@ -168,11 +168,11 @@ 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;
} }
} }
if (!function_exists('cache_forget_many')) { if (! function_exists('cache_forget_many')) {
/** /**
* Forget many cache keys at once * Forget many cache keys at once
* @param $cache * @param $cache
@@ -185,7 +185,7 @@ if (!function_exists('cache_forget_many')) {
} }
} }
if (!function_exists('get_storage')) { if (! function_exists('get_storage')) {
/** /**
* Get app version from config * Get app version from config
* *
@@ -197,7 +197,7 @@ if (!function_exists('get_storage')) {
} }
} }
if (!function_exists('is_storage_driver')) { if (! function_exists('is_storage_driver')) {
/** /**
* Check if is running AWS s3 as storage * Check if is running AWS s3 as storage
* *
@@ -213,7 +213,7 @@ if (!function_exists('is_storage_driver')) {
} }
} }
if (!function_exists('get_version')) { if (! function_exists('get_version')) {
/** /**
* Get app version from config * Get app version from config
* *
@@ -225,7 +225,7 @@ if (!function_exists('get_version')) {
} }
} }
if (!function_exists('is_demo')) { if (! function_exists('is_demo')) {
/** /**
* Check if is demo * Check if is demo
* *
@@ -237,7 +237,7 @@ if (!function_exists('is_demo')) {
} }
} }
if (!function_exists('is_demo_account')) { if (! function_exists('is_demo_account')) {
/** /**
* Check if is demo * Check if is demo
* *
@@ -250,7 +250,7 @@ if (!function_exists('is_demo_account')) {
} }
} }
if (!function_exists('get_item')) { if (! function_exists('get_item')) {
/** /**
* Get folder or file item * Get folder or file item
* *
@@ -266,7 +266,7 @@ if (!function_exists('get_item')) {
} }
} }
if (!function_exists('get_shared')) { if (! function_exists('get_shared')) {
/** /**
* Get shared token * Get shared token
* *
@@ -280,7 +280,7 @@ if (!function_exists('get_shared')) {
} }
} }
if (!function_exists('is_editor')) { if (! function_exists('is_editor')) {
/** /**
* Check if shared permission is editor * Check if shared permission is editor
* *
@@ -293,7 +293,7 @@ if (!function_exists('is_editor')) {
} }
} }
if (!function_exists('is_visitor')) { if (! function_exists('is_visitor')) {
/** /**
* Check if shared permission is visitor * Check if shared permission is visitor
* *
@@ -306,7 +306,7 @@ if (!function_exists('is_visitor')) {
} }
} }
if (!function_exists('store_avatar')) { if (! function_exists('store_avatar')) {
/** /**
* Store user avatar to storage * Store user avatar to storage
* *
@@ -316,7 +316,7 @@ if (!function_exists('store_avatar')) {
*/ */
function store_avatar($request, $name) function store_avatar($request, $name)
{ {
if (!$request->hasFile($name)) { if (! $request->hasFile($name)) {
return null; return null;
} }
@@ -345,7 +345,7 @@ if (!function_exists('store_avatar')) {
} }
} }
if (!function_exists('store_system_image')) { if (! function_exists('store_system_image')) {
/** /**
* Store system image * Store system image
* *
@@ -355,7 +355,7 @@ if (!function_exists('store_system_image')) {
*/ */
function store_system_image($request, $name) function store_system_image($request, $name)
{ {
if (!$request->hasFile($name)) { if (! $request->hasFile($name)) {
return null; return null;
} }
@@ -372,7 +372,7 @@ if (!function_exists('store_system_image')) {
} }
} }
if (!function_exists('make_single_input')) { if (! function_exists('make_single_input')) {
/** /**
* Make input from request * Make input from request
* *
@@ -392,7 +392,7 @@ if (!function_exists('make_single_input')) {
} }
} }
if (!function_exists('format_gigabytes')) { if (! function_exists('format_gigabytes')) {
/** /**
* Format integer to gigabytes * Format integer to gigabytes
* *
@@ -409,7 +409,7 @@ if (!function_exists('format_gigabytes')) {
} }
} }
if (!function_exists('format_megabytes')) { if (! function_exists('format_megabytes')) {
/** /**
* Format string to formated megabytes string * Format string to formated megabytes string
* *
@@ -430,7 +430,7 @@ if (!function_exists('format_megabytes')) {
} }
} }
if (!function_exists('format_bytes')) { if (! function_exists('format_bytes')) {
/** /**
* Convert megabytes to bytes * Convert megabytes to bytes
* *
@@ -443,7 +443,7 @@ if (!function_exists('format_bytes')) {
} }
} }
if (!function_exists('get_storage_fill_percentage')) { if (! function_exists('get_storage_fill_percentage')) {
/** /**
* Get storage usage in percent * Get storage usage in percent
* *
@@ -464,11 +464,11 @@ if (!function_exists('get_storage_fill_percentage')) {
} }
// Return in 2 decimal // Return in 2 decimal
return number_format((float)$progress, 2, '.', ''); return number_format((float) $progress, 2, '.', '');
} }
} }
if (!function_exists('user_storage_percentage')) { if (! function_exists('user_storage_percentage')) {
/** /**
* Get user capacity fill by percentage * Get user capacity fill by percentage
* *
@@ -490,7 +490,7 @@ if (!function_exists('user_storage_percentage')) {
} }
} }
if (!function_exists('recursiveFind')) { if (! function_exists('recursiveFind')) {
/** /**
* Find all key values in recursive array * Find all key values in recursive array
* *
@@ -514,7 +514,7 @@ if (!function_exists('recursiveFind')) {
} }
} }
if (!function_exists('appeared_once')) { if (! function_exists('appeared_once')) {
/** /**
* Get values which appears only once in array * Get values which appears only once in array
* @param $arr * @param $arr
@@ -536,7 +536,7 @@ if (!function_exists('appeared_once')) {
} }
} }
if (!function_exists('filter_folders_ids')) { if (! function_exists('filter_folders_ids')) {
/** /**
* @param $folders * @param $folders
* @param string $by_column * @param string $by_column
@@ -550,7 +550,7 @@ if (!function_exists('filter_folders_ids')) {
} }
} }
if (!function_exists('format_date')) { if (! function_exists('format_date')) {
/** /**
* Format localized date * Format localized date
* *
@@ -566,7 +566,7 @@ if (!function_exists('format_date')) {
} }
} }
if (!function_exists('get_file_type')) { if (! function_exists('get_file_type')) {
/** /**
* Get file type from mimetype * Get file type from mimetype
* *
@@ -586,7 +586,7 @@ if (!function_exists('get_file_type')) {
} }
} }
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
* *
@@ -601,7 +601,7 @@ if (!function_exists('map_language_translations')) {
} }
} }
if (!function_exists('get_file_type_from_mimetype')) { if (! function_exists('get_file_type_from_mimetype')) {
/** /**
* Get file type from mimetype * Get file type from mimetype
* *
@@ -614,7 +614,7 @@ if (!function_exists('get_file_type_from_mimetype')) {
} }
} }
if (!function_exists('get_pretty_name')) { if (! function_exists('get_pretty_name')) {
/** /**
* Format pretty name file * Format pretty name file
* *
@@ -639,7 +639,7 @@ if (!function_exists('get_pretty_name')) {
} }
} }
if (!function_exists('get_image_meta_data')) { if (! function_exists('get_image_meta_data')) {
/** /**
* Get exif data from jpeg image * Get exif data from jpeg image
* *
@@ -659,7 +659,7 @@ if (!function_exists('get_image_meta_data')) {
} }
} }
if (!function_exists('get_default_language_translations')) { if (! function_exists('get_default_language_translations')) {
/** /**
* @return Collection * @return Collection
*/ */
@@ -673,7 +673,7 @@ if (!function_exists('get_default_language_translations')) {
} }
} }
if (!function_exists('is_dev')) { if (! function_exists('is_dev')) {
/** /**
* Check if app is in dev mode * Check if app is in dev mode
* *
@@ -685,7 +685,7 @@ if (!function_exists('is_dev')) {
} }
} }
if (!function_exists('seems_utf8')) { if (! function_exists('seems_utf8')) {
/** /**
* @param $str * @param $str
* @return bool * @return bool
@@ -730,7 +730,7 @@ if (!function_exists('seems_utf8')) {
} }
} }
if (!function_exists('remove_accents')) { if (! function_exists('remove_accents')) {
/** /**
* Converts all accent characters to ASCII characters. * Converts all accent characters to ASCII characters.
* *
@@ -741,110 +741,110 @@ if (!function_exists('remove_accents')) {
*/ */
function remove_accents($string) function remove_accents($string)
{ {
if (!preg_match('/[\x80-\xff]/', $string)) { if (! preg_match('/[\x80-\xff]/', $string)) {
return $string; return $string;
} }
if (seems_utf8($string)) { if (seems_utf8($string)) {
$chars = [ $chars = [
// Decompositions for Latin-1 Supplement // Decompositions for Latin-1 Supplement
chr(195) . chr(128) => 'A', chr(195) . chr(129) => 'A', chr(195) . chr(128) => 'A', chr(195) . chr(129) => 'A',
chr(195) . chr(130) => 'A', chr(195) . chr(131) => 'A', chr(195) . chr(130) => 'A', chr(195) . chr(131) => 'A',
chr(195) . chr(132) => 'A', chr(195) . chr(133) => 'A', chr(195) . chr(132) => 'A', chr(195) . chr(133) => 'A',
chr(195) . chr(135) => 'C', chr(195) . chr(136) => 'E', chr(195) . chr(135) => 'C', chr(195) . chr(136) => 'E',
chr(195) . chr(137) => 'E', chr(195) . chr(138) => 'E', chr(195) . chr(137) => 'E', chr(195) . chr(138) => 'E',
chr(195) . chr(139) => 'E', chr(195) . chr(140) => 'I', chr(195) . chr(139) => 'E', chr(195) . chr(140) => 'I',
chr(195) . chr(141) => 'I', chr(195) . chr(142) => 'I', chr(195) . chr(141) => 'I', chr(195) . chr(142) => 'I',
chr(195) . chr(143) => 'I', chr(195) . chr(145) => 'N', chr(195) . chr(143) => 'I', chr(195) . chr(145) => 'N',
chr(195) . chr(146) => 'O', chr(195) . chr(147) => 'O', chr(195) . chr(146) => 'O', chr(195) . chr(147) => 'O',
chr(195) . chr(148) => 'O', chr(195) . chr(149) => 'O', chr(195) . chr(148) => 'O', chr(195) . chr(149) => 'O',
chr(195) . chr(150) => 'O', chr(195) . chr(153) => 'U', chr(195) . chr(150) => 'O', chr(195) . chr(153) => 'U',
chr(195) . chr(154) => 'U', chr(195) . chr(155) => 'U', chr(195) . chr(154) => 'U', chr(195) . chr(155) => 'U',
chr(195) . chr(156) => 'U', chr(195) . chr(157) => 'Y', chr(195) . chr(156) => 'U', chr(195) . chr(157) => 'Y',
chr(195) . chr(159) => 's', chr(195) . chr(160) => 'a', chr(195) . chr(159) => 's', chr(195) . chr(160) => 'a',
chr(195) . chr(161) => 'a', chr(195) . chr(162) => 'a', chr(195) . chr(161) => 'a', chr(195) . chr(162) => 'a',
chr(195) . chr(163) => 'a', chr(195) . chr(164) => 'a', chr(195) . chr(163) => 'a', chr(195) . chr(164) => 'a',
chr(195) . chr(165) => 'a', chr(195) . chr(167) => 'c', chr(195) . chr(165) => 'a', chr(195) . chr(167) => 'c',
chr(195) . chr(168) => 'e', chr(195) . chr(169) => 'e', chr(195) . chr(168) => 'e', chr(195) . chr(169) => 'e',
chr(195) . chr(170) => 'e', chr(195) . chr(171) => 'e', chr(195) . chr(170) => 'e', chr(195) . chr(171) => 'e',
chr(195) . chr(172) => 'i', chr(195) . chr(173) => 'i', chr(195) . chr(172) => 'i', chr(195) . chr(173) => 'i',
chr(195) . chr(174) => 'i', chr(195) . chr(175) => 'i', chr(195) . chr(174) => 'i', chr(195) . chr(175) => 'i',
chr(195) . chr(177) => 'n', chr(195) . chr(178) => 'o', chr(195) . chr(177) => 'n', chr(195) . chr(178) => 'o',
chr(195) . chr(179) => 'o', chr(195) . chr(180) => 'o', chr(195) . chr(179) => 'o', chr(195) . chr(180) => 'o',
chr(195) . chr(181) => 'o', chr(195) . chr(182) => 'o', chr(195) . chr(181) => 'o', chr(195) . chr(182) => 'o',
chr(195) . chr(182) => 'o', chr(195) . chr(185) => 'u', chr(195) . chr(182) => 'o', chr(195) . chr(185) => 'u',
chr(195) . chr(186) => 'u', chr(195) . chr(187) => 'u', chr(195) . chr(186) => 'u', chr(195) . chr(187) => 'u',
chr(195) . chr(188) => 'u', chr(195) . chr(189) => 'y', chr(195) . chr(188) => 'u', chr(195) . chr(189) => 'y',
chr(195) . chr(191) => 'y', chr(195) . chr(191) => 'y',
// Decompositions for Latin Extended-A // Decompositions for Latin Extended-A
chr(196) . chr(128) => 'A', chr(196) . chr(129) => 'a', chr(196) . chr(128) => 'A', chr(196) . chr(129) => 'a',
chr(196) . chr(130) => 'A', chr(196) . chr(131) => 'a', chr(196) . chr(130) => 'A', chr(196) . chr(131) => 'a',
chr(196) . chr(132) => 'A', chr(196) . chr(133) => 'a', chr(196) . chr(132) => 'A', chr(196) . chr(133) => 'a',
chr(196) . chr(134) => 'C', chr(196) . chr(135) => 'c', chr(196) . chr(134) => 'C', chr(196) . chr(135) => 'c',
chr(196) . chr(136) => 'C', chr(196) . chr(137) => 'c', chr(196) . chr(136) => 'C', chr(196) . chr(137) => 'c',
chr(196) . chr(138) => 'C', chr(196) . chr(139) => 'c', chr(196) . chr(138) => 'C', chr(196) . chr(139) => 'c',
chr(196) . chr(140) => 'C', chr(196) . chr(141) => 'c', chr(196) . chr(140) => 'C', chr(196) . chr(141) => 'c',
chr(196) . chr(142) => 'D', chr(196) . chr(143) => 'd', chr(196) . chr(142) => 'D', chr(196) . chr(143) => 'd',
chr(196) . chr(144) => 'D', chr(196) . chr(145) => 'd', chr(196) . chr(144) => 'D', chr(196) . chr(145) => 'd',
chr(196) . chr(146) => 'E', chr(196) . chr(147) => 'e', chr(196) . chr(146) => 'E', chr(196) . chr(147) => 'e',
chr(196) . chr(148) => 'E', chr(196) . chr(149) => 'e', chr(196) . chr(148) => 'E', chr(196) . chr(149) => 'e',
chr(196) . chr(150) => 'E', chr(196) . chr(151) => 'e', chr(196) . chr(150) => 'E', chr(196) . chr(151) => 'e',
chr(196) . chr(152) => 'E', chr(196) . chr(153) => 'e', chr(196) . chr(152) => 'E', chr(196) . chr(153) => 'e',
chr(196) . chr(154) => 'E', chr(196) . chr(155) => 'e', chr(196) . chr(154) => 'E', chr(196) . chr(155) => 'e',
chr(196) . chr(156) => 'G', chr(196) . chr(157) => 'g', chr(196) . chr(156) => 'G', chr(196) . chr(157) => 'g',
chr(196) . chr(158) => 'G', chr(196) . chr(159) => 'g', chr(196) . chr(158) => 'G', chr(196) . chr(159) => 'g',
chr(196) . chr(160) => 'G', chr(196) . chr(161) => 'g', chr(196) . chr(160) => 'G', chr(196) . chr(161) => 'g',
chr(196) . chr(162) => 'G', chr(196) . chr(163) => 'g', chr(196) . chr(162) => 'G', chr(196) . chr(163) => 'g',
chr(196) . chr(164) => 'H', chr(196) . chr(165) => 'h', chr(196) . chr(164) => 'H', chr(196) . chr(165) => 'h',
chr(196) . chr(166) => 'H', chr(196) . chr(167) => 'h', chr(196) . chr(166) => 'H', chr(196) . chr(167) => 'h',
chr(196) . chr(168) => 'I', chr(196) . chr(169) => 'i', chr(196) . chr(168) => 'I', chr(196) . chr(169) => 'i',
chr(196) . chr(170) => 'I', chr(196) . chr(171) => 'i', chr(196) . chr(170) => 'I', chr(196) . chr(171) => 'i',
chr(196) . chr(172) => 'I', chr(196) . chr(173) => 'i', chr(196) . chr(172) => 'I', chr(196) . chr(173) => 'i',
chr(196) . chr(174) => 'I', chr(196) . chr(175) => 'i', chr(196) . chr(174) => 'I', chr(196) . chr(175) => 'i',
chr(196) . chr(176) => 'I', chr(196) . chr(177) => 'i', chr(196) . chr(176) => 'I', chr(196) . chr(177) => 'i',
chr(196) . chr(178) => 'IJ', chr(196) . chr(179) => 'ij', chr(196) . chr(178) => 'IJ', chr(196) . chr(179) => 'ij',
chr(196) . chr(180) => 'J', chr(196) . chr(181) => 'j', chr(196) . chr(180) => 'J', chr(196) . chr(181) => 'j',
chr(196) . chr(182) => 'K', chr(196) . chr(183) => 'k', chr(196) . chr(182) => 'K', chr(196) . chr(183) => 'k',
chr(196) . chr(184) => 'k', chr(196) . chr(185) => 'L', chr(196) . chr(184) => 'k', chr(196) . chr(185) => 'L',
chr(196) . chr(186) => 'l', chr(196) . chr(187) => 'L', chr(196) . chr(186) => 'l', chr(196) . chr(187) => 'L',
chr(196) . chr(188) => 'l', chr(196) . chr(189) => 'L', chr(196) . chr(188) => 'l', chr(196) . chr(189) => 'L',
chr(196) . chr(190) => 'l', chr(196) . chr(191) => 'L', chr(196) . chr(190) => 'l', chr(196) . chr(191) => 'L',
chr(197) . chr(128) => 'l', chr(197) . chr(129) => 'L', chr(197) . chr(128) => 'l', chr(197) . chr(129) => 'L',
chr(197) . chr(130) => 'l', chr(197) . chr(131) => 'N', chr(197) . chr(130) => 'l', chr(197) . chr(131) => 'N',
chr(197) . chr(132) => 'n', chr(197) . chr(133) => 'N', chr(197) . chr(132) => 'n', chr(197) . chr(133) => 'N',
chr(197) . chr(134) => 'n', chr(197) . chr(135) => 'N', chr(197) . chr(134) => 'n', chr(197) . chr(135) => 'N',
chr(197) . chr(136) => 'n', chr(197) . chr(137) => 'N', chr(197) . chr(136) => 'n', chr(197) . chr(137) => 'N',
chr(197) . chr(138) => 'n', chr(197) . chr(139) => 'N', chr(197) . chr(138) => 'n', chr(197) . chr(139) => 'N',
chr(197) . chr(140) => 'O', chr(197) . chr(141) => 'o', chr(197) . chr(140) => 'O', chr(197) . chr(141) => 'o',
chr(197) . chr(142) => 'O', chr(197) . chr(143) => 'o', chr(197) . chr(142) => 'O', chr(197) . chr(143) => 'o',
chr(197) . chr(144) => 'O', chr(197) . chr(145) => 'o', chr(197) . chr(144) => 'O', chr(197) . chr(145) => 'o',
chr(197) . chr(146) => 'OE', chr(197) . chr(147) => 'oe', chr(197) . chr(146) => 'OE', chr(197) . chr(147) => 'oe',
chr(197) . chr(148) => 'R', chr(197) . chr(149) => 'r', chr(197) . chr(148) => 'R', chr(197) . chr(149) => 'r',
chr(197) . chr(150) => 'R', chr(197) . chr(151) => 'r', chr(197) . chr(150) => 'R', chr(197) . chr(151) => 'r',
chr(197) . chr(152) => 'R', chr(197) . chr(153) => 'r', chr(197) . chr(152) => 'R', chr(197) . chr(153) => 'r',
chr(197) . chr(154) => 'S', chr(197) . chr(155) => 's', chr(197) . chr(154) => 'S', chr(197) . chr(155) => 's',
chr(197) . chr(156) => 'S', chr(197) . chr(157) => 's', chr(197) . chr(156) => 'S', chr(197) . chr(157) => 's',
chr(197) . chr(158) => 'S', chr(197) . chr(159) => 's', chr(197) . chr(158) => 'S', chr(197) . chr(159) => 's',
chr(197) . chr(160) => 'S', chr(197) . chr(161) => 's', chr(197) . chr(160) => 'S', chr(197) . chr(161) => 's',
chr(197) . chr(162) => 'T', chr(197) . chr(163) => 't', chr(197) . chr(162) => 'T', chr(197) . chr(163) => 't',
chr(197) . chr(164) => 'T', chr(197) . chr(165) => 't', chr(197) . chr(164) => 'T', chr(197) . chr(165) => 't',
chr(197) . chr(166) => 'T', chr(197) . chr(167) => 't', chr(197) . chr(166) => 'T', chr(197) . chr(167) => 't',
chr(197) . chr(168) => 'U', chr(197) . chr(169) => 'u', chr(197) . chr(168) => 'U', chr(197) . chr(169) => 'u',
chr(197) . chr(170) => 'U', chr(197) . chr(171) => 'u', chr(197) . chr(170) => 'U', chr(197) . chr(171) => 'u',
chr(197) . chr(172) => 'U', chr(197) . chr(173) => 'u', chr(197) . chr(172) => 'U', chr(197) . chr(173) => 'u',
chr(197) . chr(174) => 'U', chr(197) . chr(175) => 'u', chr(197) . chr(174) => 'U', chr(197) . chr(175) => 'u',
chr(197) . chr(176) => 'U', chr(197) . chr(177) => 'u', chr(197) . chr(176) => 'U', chr(197) . chr(177) => 'u',
chr(197) . chr(178) => 'U', chr(197) . chr(179) => 'u', chr(197) . chr(178) => 'U', chr(197) . chr(179) => 'u',
chr(197) . chr(180) => 'W', chr(197) . chr(181) => 'w', chr(197) . chr(180) => 'W', chr(197) . chr(181) => 'w',
chr(197) . chr(182) => 'Y', chr(197) . chr(183) => 'y', chr(197) . chr(182) => 'Y', chr(197) . chr(183) => 'y',
chr(197) . chr(184) => 'Y', chr(197) . chr(185) => 'Z', chr(197) . chr(184) => 'Y', chr(197) . chr(185) => 'Z',
chr(197) . chr(186) => 'z', chr(197) . chr(187) => 'Z', chr(197) . chr(186) => 'z', chr(197) . chr(187) => 'Z',
chr(197) . chr(188) => 'z', chr(197) . chr(189) => 'Z', chr(197) . chr(188) => 'z', chr(197) . chr(189) => 'Z',
chr(197) . chr(190) => 'z', chr(197) . chr(191) => 's', chr(197) . chr(190) => 'z', chr(197) . chr(191) => 's',
// 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 {
@@ -872,8 +872,7 @@ if (!function_exists('remove_accents')) {
} }
} }
if (!function_exists('get_files_for_zip')) { if (! function_exists('get_files_for_zip')) {
/** /**
* Get all files from folder and get their folder location in VueFileManager directories * Get all files from folder and get their folder location in VueFileManager directories
* *
@@ -885,7 +884,7 @@ if (!function_exists('get_files_for_zip')) {
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();
} }
@@ -895,9 +894,9 @@ if (!function_exists('get_files_for_zip')) {
// Push file to collection // Push file to collection
$folders->files->each(function ($file) use ($files, $path) { $folders->files->each(function ($file) use ($files, $path) {
$files->push([ $files->push([
'name' => $file->name, 'name' => $file->name,
'basename' => $file->basename, 'basename' => $file->basename,
'mimetype' => $file->mimetype, 'mimetype' => $file->mimetype,
'folder_path' => implode('/', $path), 'folder_path' => implode('/', $path),
]); ]);
}); });
@@ -913,7 +912,7 @@ if (!function_exists('get_files_for_zip')) {
} }
} }
if (!function_exists('set_time_by_user_timezone')) { if (! function_exists('set_time_by_user_timezone')) {
/** /**
* Set time by user timezone GMT * Set time by user timezone GMT
* *
@@ -934,7 +933,7 @@ if (!function_exists('set_time_by_user_timezone')) {
} }
} }
if (!function_exists('__t')) { if (! function_exists('__t')) {
/** /**
* Translate the given message. * Translate the given message.
* @param $key * @param $key
@@ -955,12 +954,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);
@@ -973,7 +972,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
* *
@@ -985,7 +984,7 @@ if (!function_exists('replace_occurrence')) {
{ {
$occurrences = $values->map(function ($message, $key) { $occurrences = $values->map(function ($message, $key) {
return [ return [
'key' => ":$key", 'key' => ":$key",
'message' => $message, 'message' => $message,
]; ];
}); });