Update (copies)

This commit is contained in:
2023-12-03 11:20:03 +08:00
parent 97dc13e785
commit 38c53b4045
13 changed files with 103 additions and 104 deletions

View File

@@ -4,7 +4,8 @@
use Illuminate\Support\Str;
if (! function_exists('count_words')) {
function count_words($string) {
function count_words($string)
{
// Remove punctuation and line breaks
$cleanString = preg_replace('/[\p{P}\s]/u', ' ', $string);
@@ -16,9 +17,9 @@ function count_words($string) {
}
}
if (! function_exists('get_country_names')) {
function get_country_names($lowercase = false) {
function get_country_names($lowercase = false)
{
$countryCodes = config('platform.country_codes');
$countryNames = [];
@@ -34,7 +35,6 @@ function get_country_names($lowercase = false) {
}
}
if (! function_exists('is_valid_url')) {
function is_valid_url($url)
{
@@ -195,7 +195,7 @@ function get_domain_from_url($url)
$parse = parse_url($url);
// Check if 'host' key exists in the parsed URL array
if (!isset($parse['host'])) {
if (! isset($parse['host'])) {
return null; // or you can throw an exception or handle this case as per your requirement
}