diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 3e2562c..b233fbe 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -24,6 +24,7 @@ jobs: - "8.1" - "8.2" - "8.3" + - "8.4" steps: - name: "Checkout" diff --git a/src/Readability.php b/src/Readability.php index b0b815f..6fb88ad 100644 --- a/src/Readability.php +++ b/src/Readability.php @@ -668,10 +668,10 @@ class Readability implements LoggerAwareInterface $this->logger->debug(' content length less than 6 chars, 0 embeds and either 0 images or more than 2 images'); $toRemove = true; } elseif (!$isList && $weight < 25 && $linkDensity > 0.25) { - $this->logger->debug(' weight is ' . $weight . ' < 25 and link density is ' . sprintf('%.2f', $linkDensity) . ' > 0.25'); + $this->logger->debug(' weight is ' . $weight . ' < 25 and link density is ' . \sprintf('%.2f', $linkDensity) . ' > 0.25'); $toRemove = true; } elseif ($a > 2 && ($weight >= 25 && $linkDensity > 0.5)) { - $this->logger->debug(' more than 2 links and weight is ' . $weight . ' > 25 but link density is ' . sprintf('%.2f', $linkDensity) . ' > 0.5'); + $this->logger->debug(' more than 2 links and weight is ' . $weight . ' > 25 but link density is ' . \sprintf('%.2f', $linkDensity) . ' > 0.5'); $toRemove = true; } elseif ($embedCount > 3) { $this->logger->debug(' more than 3 embeds'); @@ -691,10 +691,10 @@ class Readability implements LoggerAwareInterface $this->logger->debug(' content length less than 10 chars and 0 images, or more than 2 images'); $toRemove = true; } elseif (!$isList && $weight < 25 && $linkDensity > 0.2) { - $this->logger->debug(' weight is ' . $weight . ' lower than 0 and link density is ' . sprintf('%.2f', $linkDensity) . ' > 0.2'); + $this->logger->debug(' weight is ' . $weight . ' lower than 0 and link density is ' . \sprintf('%.2f', $linkDensity) . ' > 0.2'); $toRemove = true; } elseif ($weight >= 25 && $linkDensity > 0.5) { - $this->logger->debug(' weight above 25 but link density is ' . sprintf('%.2f', $linkDensity) . ' > 0.5'); + $this->logger->debug(' weight above 25 but link density is ' . \sprintf('%.2f', $linkDensity) . ' > 0.5'); $toRemove = true; } elseif ((1 === $embedCount && $contentLength < 75) || $embedCount > 1) { $this->logger->debug(' 1 embed and content length smaller than 75 chars, or more than one embed'); diff --git a/tests/ReadabilityTest.php b/tests/ReadabilityTest.php index 3fb9dc0..8a29629 100644 --- a/tests/ReadabilityTest.php +++ b/tests/ReadabilityTest.php @@ -335,12 +335,12 @@ class ReadabilityTest extends \PHPUnit\Framework\TestCase public function testAutoClosingIframeNotThrowingException(): void { - $oldErrorReporting = error_reporting(\E_ALL | \E_STRICT); + $oldErrorReporting = error_reporting(\E_ALL); $oldDisplayErrors = ini_set('display_errors', '1'); // dummy function to be used to the next test - set_error_handler(function (int $errno, string $errstr, string $errfile, int $errline, array $errcontext) { + set_error_handler(function (int $errno, string $errstr, string $errfile, int $errline) { throw new \Exception($errstr, $errno); - }, \E_ALL | \E_STRICT); + }); try { $data = '