Skip to content

Commit

Permalink
fix: fixed php stan issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jeslage committed Apr 14, 2023
1 parent f60c59e commit a398d01
Showing 1 changed file with 35 additions and 35 deletions.
70 changes: 35 additions & 35 deletions site/snippets/image.php
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
<?php
/* Defaults */
<?php if (isset($image) && isset($src)): ?>
<?php
/* Defaults */

$loading = $loading ?? 'lazy';
$loading = $loading ?? 'lazy';

$thumb = $image->thumb($src);
$thumb = $image->thumb($src);

/*
snippet('image', [
'image' => $image,
'class' => 'blog',
'src' => $image->thumb([
'width' => 300,
'height' => 300,
'quality' => 80,
'crop' => center,
'quality' => 80]
)->url(),
'srcset' => [
'300w' => ['width' => 300, 'height' => 300, 'crop' => 'center', 'quality' => 80],
'1800w' => ['width' => 1800, 'height' => 1800, 'crop' => 'center', 'quality' => 80],
],
'sizes' => '(min-width: 1280px) 25vw, (min-width: 1024px) 50vw, 100vw',
'loading' => 'Lazy'
])
*/
?>
/*
snippet('image', [
'image' => $image,
'class' => 'blog',
'src' => [
'width' => 300,
'height' => 300,
'quality' => 80,
'crop' => center,
'quality' => 80]
],
'srcset' => [
'300w' => ['width' => 300, 'height' => 300, 'crop' => 'center', 'quality' => 80],
'1800w' => ['width' => 1800, 'height' => 1800, 'crop' => 'center', 'quality' => 80],
],
'sizes' => '(min-width: 1280px) 25vw, (min-width: 1024px) 50vw, 100vw',
'loading' => 'Lazy'
])
*/
?>

<?php if (isset($image) && isset($src)): ?>
<img
alt="<?= $image->alt() ?>"
width="<?= $thumb->width() ?>"
height="<?= $thumb->height() ?>"
src="<?= $thumb->url() ?>"
loading="<?= $loading ?>"
<?php if (isset($srcset)): ?>srcset="<?= $image->srcset($srcset) ?>"<?php endif ?>
<?php if (isset($sizes)): ?>sizes="<?= $sizes ?>"<?php endif ?>
<?php if (isset($class)): ?>class="<?= $class ?>"<?php endif ?>
>
<img
alt="<?= $image->alt() ?>"
width="<?= $thumb->width() ?>"
height="<?= $thumb->height() ?>"
src="<?= $thumb->url() ?>"
loading="<?= $loading ?>"
<?php if (isset($srcset)): ?>srcset="<?= $image->srcset($srcset) ?>"<?php endif ?>
<?php if (isset($sizes)): ?>sizes="<?= $sizes ?>"<?php endif ?>
<?php if (isset($class)): ?>class="<?= $class ?>"<?php endif ?>
>
<?php endif ?>

0 comments on commit a398d01

Please sign in to comment.