From 46b1b46437876369530e5f232922d2110e9cd9f2 Mon Sep 17 00:00:00 2001 From: Baspa Date: Thu, 17 Aug 2023 07:17:08 +0000 Subject: [PATCH] Fix styling --- src/Checks/Content/ContentLengthCheck.php | 2 ++ src/Seo.php | 12 ++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/Checks/Content/ContentLengthCheck.php b/src/Checks/Content/ContentLengthCheck.php index d9c93ad3..3454d915 100644 --- a/src/Checks/Content/ContentLengthCheck.php +++ b/src/Checks/Content/ContentLengthCheck.php @@ -67,10 +67,12 @@ public function getContentToValidate(Response $response, Crawler $crawler): ?str * This is a fallback for when Readability is unable to parse the content. * Sometimes it happens when scanning a JavaScript rendered page, that * we don't get a proper response. In that case we just return null. + * * @todo we should check if we can improve this. */ if ($textContent == 'Sorry, Readability was unable to parse this page for content.') { $this->failureReason = __('failed.content.length.parse'); + return null; } diff --git a/src/Seo.php b/src/Seo.php index 9c60ee63..737356dd 100755 --- a/src/Seo.php +++ b/src/Seo.php @@ -2,16 +2,16 @@ namespace Vormkracht10\Seo; -use Illuminate\Support\Arr; -use Illuminate\Support\Str; use Illuminate\Http\Client\Response; use Illuminate\Pipeline\Pipeline; +use Illuminate\Support\Arr; use Illuminate\Support\Collection; -use Spatie\Browsershot\Browsershot; use Illuminate\Support\Facades\Http; -use Symfony\Component\Finder\Finder; -use Symfony\Component\DomCrawler\Crawler; +use Illuminate\Support\Str; +use Spatie\Browsershot\Browsershot; use Symfony\Component\Console\Helper\ProgressBar; +use Symfony\Component\DomCrawler\Crawler; +use Symfony\Component\Finder\Finder; class Seo { @@ -77,7 +77,7 @@ private function visitPage(string $url): object return $response; } - private function runChecks(Response $response, ?string $javascriptResponse = null): void + private function runChecks(Response $response, string $javascriptResponse = null): void { $checks = self::orderedCheckClasses();