Skip to content
Snippets Groups Projects
Commit 22a5eada authored by Johannes Kreiner's avatar Johannes Kreiner
Browse files

[TASK] Fix PHPStan errors

parent 49d51cd4
No related branches found
Tags 4.1.3
No related merge requests found
......@@ -224,7 +224,7 @@ class PictureViewHelper extends AbstractViewHelper {
}
$originalFile = $image;
if (!($originalFile instanceof File)) {
if (!($originalFile instanceof File) && method_exists($image, 'getOriginalFile')) {
$originalFile = $image->getOriginalFile();
}
......@@ -315,7 +315,7 @@ class PictureViewHelper extends AbstractViewHelper {
}
}
$titleAsAttribute = $title ? ' title="' . htmlspecialchars($title ?? '') . '"' : '';
$titleAsAttribute = $title ? ' title="' . htmlspecialchars($title) . '"' : '';
$loadingDirective = '';
if (isset($arguments['loadingDirective']) && $arguments['loadingDirective'] !== 'none') {
$arguments['loadingDirective'] = $arguments['loadingDirective'] !== '' ?
......@@ -327,7 +327,7 @@ class PictureViewHelper extends AbstractViewHelper {
$sources .
'<img ' . $idAsAttribute . ' class="image-embed-item ' . $class . '"' .
$widthAsAttribute . $heightAsAttribute . $titleAsAttribute .
' alt="' . htmlspecialchars($alternative ?? '') . '" src="' . $imageUrl . '"' . $loadingDirective . ' />' .
' alt="' . htmlspecialchars($alternative) . '" src="' . $imageUrl . '"' . $loadingDirective . ' />' .
'</picture>';
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment