Update (copies)
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
|
||||
namespace App\Helpers\FirstParty\SitemapCrawler;
|
||||
|
||||
use Spatie\Crawler\CrawlProfiles\CrawlProfile;
|
||||
use Psr\Http\Message\UriInterface;
|
||||
use Spatie\Crawler\CrawlProfiles\CrawlProfile;
|
||||
|
||||
class CustomCrawlProfile extends CrawlProfile
|
||||
{
|
||||
@@ -20,9 +20,7 @@ public function shouldCrawl(UriInterface $url): bool
|
||||
if ($url->getQuery() !== '') {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return ($this->callback)($url);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user