Apply PHP-CS-Fixer fixes

This commit is contained in:
Yassine Guedidi
2024-01-01 19:11:01 +01:00
parent e938cc8687
commit 0a117958c9
68 changed files with 67 additions and 519 deletions

View File

@ -162,7 +162,7 @@ class DownloadImages
$cleanSVG = $sanitizer->sanitize((string) $res->getBody());
// add an extra validation by checking about `<svg `
if (false === $cleanSVG || false === strpos($cleanSVG, '<svg ')) {
if (false === $cleanSVG || !str_contains($cleanSVG, '<svg ')) {
$this->logger->error('DownloadImages: Bad SVG given', ['path' => $imagePath]);
return false;
@ -373,7 +373,7 @@ class DownloadImages
$bytes = substr((string) $res->getBody(), 0, 8);
foreach ($types as $type => $header) {
if (0 === strpos($bytes, $header)) {
if (str_starts_with($bytes, $header)) {
$ext = $type;
break;
}