From de04399e5dd0d74c4234833cb1df5ef147766e4c Mon Sep 17 00:00:00 2001 From: StyleCI Bot Date: Sun, 3 Apr 2022 11:15:27 +0000 Subject: [PATCH] Apply fixes from StyleCI --- src/Helpers/AdminHelper.php | 64 ++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/src/Helpers/AdminHelper.php b/src/Helpers/AdminHelper.php index 88605aa..176a62c 100644 --- a/src/Helpers/AdminHelper.php +++ b/src/Helpers/AdminHelper.php @@ -1,6 +1,6 @@ ', '&', '{', '}', '*', '\\', '/', ':', '.', ';', ',', "'", '"'], '_', $name ?? trim($default))); } } -if (!function_exists('getImagePlaceholder')) { +if (! function_exists('getImagePlaceholder')) { function getImagePlaceholder() { return asset('adminetic/static/placeholder.png'); } } -if (!function_exists('getVerticalImagePlaceholder')) { +if (! function_exists('getVerticalImagePlaceholder')) { function getVerticalImagePlaceholder() { return asset('adminetic/static/vertical_placeholder.jpg'); } } -if (!function_exists('getSliderPlaceholder')) { +if (! function_exists('getSliderPlaceholder')) { function getSliderPlaceholder() { return asset('adminetic/static/slider.jpg'); } } -if (!function_exists('getFoodImagePlaceholder')) { +if (! function_exists('getFoodImagePlaceholder')) { function getFoodImagePlaceholder() { return asset('adminetic/static/food_placeholder.jpg'); } } -if (!function_exists('getProfilePlaceholder')) { +if (! function_exists('getProfilePlaceholder')) { function getProfilePlaceholder($p = null) { $profile = $p ?? Auth::user()->profile ?? Auth::user()->profile()->create(); - return isset($profile->profile_pic) ? (Illuminate\Support\Str::contains($profile->profile_pic, ['https://', 'http://']) ? $profile->profile_pic : asset('storage/' . $profile->profile_pic)) : asset('adminetic/static/profile.jpg'); + return isset($profile->profile_pic) ? (Illuminate\Support\Str::contains($profile->profile_pic, ['https://', 'http://']) ? $profile->profile_pic : asset('storage/'.$profile->profile_pic)) : asset('adminetic/static/profile.jpg'); } } -if (!function_exists('title')) { +if (! function_exists('title')) { function title() { return setting('title', config('adminetic.name', 'Adminetic')); } } -if (!function_exists('loader_enabled')) { +if (! function_exists('loader_enabled')) { function loader_enabled() { return setting('loader_enabled', config('adminetic.loader_enabled', true)); } } -if (!function_exists('favicon')) { +if (! function_exists('favicon')) { function favicon() { - return setting('favicon') ? (asset('storage/' . setting('favicon'))) : asset('adminetic/static/favicon.png'); + return setting('favicon') ? (asset('storage/'.setting('favicon'))) : asset('adminetic/static/favicon.png'); } } -if (!function_exists('logo')) { +if (! function_exists('logo')) { function logo() { - return setting('logo') ? (asset('storage/' . setting('logo'))) : asset('adminetic/static/logo.png'); + return setting('logo') ? (asset('storage/'.setting('logo'))) : asset('adminetic/static/logo.png'); } } -if (!function_exists('dark_logo')) { +if (! function_exists('dark_logo')) { function dark_logo() { - return setting('dark_logo') ? (asset('storage/' . setting('dark_logo'))) : asset('adminetic/static/logo_dark.png'); + return setting('dark_logo') ? (asset('storage/'.setting('dark_logo'))) : asset('adminetic/static/logo_dark.png'); } } -if (!function_exists('getLogoBanner')) { +if (! function_exists('getLogoBanner')) { function getLogoBanner() { - return setting('logo_banner') ? (asset('storage/' . setting('logo_banner'))) : asset('adminetic/static/logo_banner.jpg'); + return setting('logo_banner') ? (asset('storage/'.setting('logo_banner'))) : asset('adminetic/static/logo_banner.jpg'); } } -if (!function_exists('login_register_bg_image')) { +if (! function_exists('login_register_bg_image')) { function login_register_bg_image() { - return setting('login_register_bg_image') ? (asset('storage/' . setting('login_register_bg_image'))) : asset('adminetic/static/login_register_bg_img.jpg'); + return setting('login_register_bg_image') ? (asset('storage/'.setting('login_register_bg_image'))) : asset('adminetic/static/login_register_bg_img.jpg'); } } -if (!function_exists('getLazyLoadImg')) { +if (! function_exists('getLazyLoadImg')) { function getLazyLoadImg() { return asset('adminetic/static/loader.svg'); } } -if (!function_exists('random_color_part')) { +if (! function_exists('random_color_part')) { function random_color_part() { return str_pad(dechex(mt_rand(0, 255)), 2, '0', STR_PAD_LEFT); } } -if (!function_exists('random_color')) { +if (! function_exists('random_color')) { function random_color() { - return random_color_part() . random_color_part() . random_color_part(); + return random_color_part().random_color_part().random_color_part(); } } -if (!function_exists('setting')) { +if (! function_exists('setting')) { function setting($setting_name, $default = null) { $valid_setting_name = strtolower(str_replace(' ', '_', $setting_name)); @@ -153,7 +153,7 @@ function setting($setting_name, $default = null) } } -if (!function_exists('preference')) { +if (! function_exists('preference')) { function preference($preference_name, bool $default = null) { $valid_preference_name = strtolower(str_replace(' ', '_', $preference_name)); @@ -167,25 +167,25 @@ function preference($preference_name, bool $default = null) } } -if (!function_exists('deleteImage')) { +if (! function_exists('deleteImage')) { function deleteImage($image) { - $image ? (\Illuminate\Support\Facades\File::exists(public_path('storage/' . $image)) ? \Illuminate\Support\Facades\File::delete(public_path('storage/' . $image)) : '') : ''; + $image ? (\Illuminate\Support\Facades\File::exists(public_path('storage/'.$image)) ? \Illuminate\Support\Facades\File::delete(public_path('storage/'.$image)) : '') : ''; } } -if (!function_exists('darkMode')) { +if (! function_exists('darkMode')) { function darkMode() { return setting('dark_mode', config('adminetic.dark_mode', false)); } } -if (!function_exists('getCondition')) { +if (! function_exists('getCondition')) { function getCondition($conditions) { $result = null; - if (!isset($conditions)) { + if (! isset($conditions)) { return false; }