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

@ -98,7 +98,7 @@ class ContentProxy
$errors = $this->validator->validate(
$value,
(new LocaleConstraint(['canonicalize' => true]))
new LocaleConstraint(['canonicalize' => true])
);
if (0 === \count($errors)) {
@ -119,7 +119,7 @@ class ContentProxy
{
$errors = $this->validator->validate(
$value,
(new UrlConstraint())
new UrlConstraint()
);
if (0 === \count($errors)) {
@ -207,8 +207,6 @@ class ContentProxy
* If the title from the fetched content comes from a PDF, then its very possible that the character encoding is not
* UTF-8. This methods tries to identify the character encoding and translate the title to UTF-8.
*
* @param $title
*
* @return string (maybe contains invalid UTF-8 character)
*/
private function convertPdfEncodingToUTF8($title)

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;
}

View File

@ -44,8 +44,8 @@ class Redirect
return $url;
}
if (!$ignoreActionMarkAsRead &&
Config::REDIRECT_TO_HOMEPAGE === $user->getConfig()->getActionMarkAsRead()) {
if (!$ignoreActionMarkAsRead
&& Config::REDIRECT_TO_HOMEPAGE === $user->getConfig()->getActionMarkAsRead()) {
return $this->router->generate('homepage');
}