From b3c4de5a34174988c109a57f67797bfa1302d860 Mon Sep 17 00:00:00 2001 From: Claudio-Emmolo Date: Thu, 13 Jun 2024 13:37:12 +0000 Subject: [PATCH] Fix styling --- src/Shortcodes/PhotoShortcode.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Shortcodes/PhotoShortcode.php b/src/Shortcodes/PhotoShortcode.php index 70a0569..a63764f 100644 --- a/src/Shortcodes/PhotoShortcode.php +++ b/src/Shortcodes/PhotoShortcode.php @@ -6,7 +6,7 @@ class PhotoShortcode { public function register($shortcode): string { - if (!class_exists('\Outl1ne\NovaMediaHub\Models\Media')) { + if (! class_exists('\Outl1ne\NovaMediaHub\Models\Media')) { return ''; } @@ -23,7 +23,7 @@ public function register($shortcode): string }); foreach ($images as $key => $image) { - $images[$key]['src'] = $image->path . $image->file_name; + $images[$key]['src'] = $image->path.$image->file_name; $images[$key]['title'] = $image['data']['title'][0] ?? null; $images[$key]['alt'] = $image['data']['alt'][0] ?? null; } @@ -43,11 +43,11 @@ public function register($shortcode): string // Single image $media = \Outl1ne\NovaMediaHub\Models\Media::find($shortcode->id); - if (!$media) { + if (! $media) { return ''; } - $path = $media->path . $media->file_name; + $path = $media->path.$media->file_name; $align = $shortcode->align ?? null; $link = $shortcode->link ? str_replace("'", '%27', $shortcode->link) : null; $shape = $shortcode->shape ?? null; @@ -64,7 +64,7 @@ public function register($shortcode): string if (is_array($credits)) { $credits = $credits[0]; } - $alt = $media->data['alt'] ?? 'Immagine id ' . $shortcode->id; + $alt = $media->data['alt'] ?? 'Immagine id '.$shortcode->id; if (is_array($alt)) { $alt = $alt[0]; } @@ -93,10 +93,10 @@ public function register($shortcode): string public static function getImageHeight(string $path, int $width = 0): float|int { - $localPath = storage_path('app/public/' . $path); + $localPath = storage_path('app/public/'.$path); // Check if file exists - if (!file_exists($localPath)) { + if (! file_exists($localPath)) { return 0; }