Skip to content

Commit 6947999

Browse files
authored
Merge pull request #92 from jtojnar/ci-fix
ci: Fix & add PHP 8.4
2 parents cb6b6ac + da75501 commit 6947999

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
- "8.1"
2525
- "8.2"
2626
- "8.3"
27+
- "8.4"
2728

2829
steps:
2930
- name: "Checkout"

src/Readability.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -668,10 +668,10 @@ public function cleanConditionally(\DOMElement $e, string $tag): void
668668
$this->logger->debug(' content length less than 6 chars, 0 embeds and either 0 images or more than 2 images');
669669
$toRemove = true;
670670
} elseif (!$isList && $weight < 25 && $linkDensity > 0.25) {
671-
$this->logger->debug(' weight is ' . $weight . ' < 25 and link density is ' . sprintf('%.2f', $linkDensity) . ' > 0.25');
671+
$this->logger->debug(' weight is ' . $weight . ' < 25 and link density is ' . \sprintf('%.2f', $linkDensity) . ' > 0.25');
672672
$toRemove = true;
673673
} elseif ($a > 2 && ($weight >= 25 && $linkDensity > 0.5)) {
674-
$this->logger->debug(' more than 2 links and weight is ' . $weight . ' > 25 but link density is ' . sprintf('%.2f', $linkDensity) . ' > 0.5');
674+
$this->logger->debug(' more than 2 links and weight is ' . $weight . ' > 25 but link density is ' . \sprintf('%.2f', $linkDensity) . ' > 0.5');
675675
$toRemove = true;
676676
} elseif ($embedCount > 3) {
677677
$this->logger->debug(' more than 3 embeds');
@@ -691,10 +691,10 @@ public function cleanConditionally(\DOMElement $e, string $tag): void
691691
$this->logger->debug(' content length less than 10 chars and 0 images, or more than 2 images');
692692
$toRemove = true;
693693
} elseif (!$isList && $weight < 25 && $linkDensity > 0.2) {
694-
$this->logger->debug(' weight is ' . $weight . ' lower than 0 and link density is ' . sprintf('%.2f', $linkDensity) . ' > 0.2');
694+
$this->logger->debug(' weight is ' . $weight . ' lower than 0 and link density is ' . \sprintf('%.2f', $linkDensity) . ' > 0.2');
695695
$toRemove = true;
696696
} elseif ($weight >= 25 && $linkDensity > 0.5) {
697-
$this->logger->debug(' weight above 25 but link density is ' . sprintf('%.2f', $linkDensity) . ' > 0.5');
697+
$this->logger->debug(' weight above 25 but link density is ' . \sprintf('%.2f', $linkDensity) . ' > 0.5');
698698
$toRemove = true;
699699
} elseif ((1 === $embedCount && $contentLength < 75) || $embedCount > 1) {
700700
$this->logger->debug(' 1 embed and content length smaller than 75 chars, or more than one embed');

tests/ReadabilityTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -335,12 +335,12 @@ public function testTitleTooShortUseH1(): void
335335

336336
public function testAutoClosingIframeNotThrowingException(): void
337337
{
338-
$oldErrorReporting = error_reporting(\E_ALL | \E_STRICT);
338+
$oldErrorReporting = error_reporting(\E_ALL);
339339
$oldDisplayErrors = ini_set('display_errors', '1');
340340
// dummy function to be used to the next test
341-
set_error_handler(function (int $errno, string $errstr, string $errfile, int $errline, array $errcontext) {
341+
set_error_handler(function (int $errno, string $errstr, string $errfile, int $errline) {
342342
throw new \Exception($errstr, $errno);
343-
}, \E_ALL | \E_STRICT);
343+
});
344344

345345
try {
346346
$data = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

0 commit comments

Comments
 (0)