Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
Claudio-Emmolo authored and github-actions[bot] committed Jun 13, 2024
1 parent eb56f46 commit b3c4de5
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/Shortcodes/PhotoShortcode.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 '';
}

Expand All @@ -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;
}
Expand All @@ -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;
Expand All @@ -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];
}
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit b3c4de5

Please sign in to comment.