@@ -6,7 +6,7 @@ class PhotoShortcode
6
6
{
7
7
public function register ($ shortcode ): string
8
8
{
9
- if (!class_exists ('\Outl1ne\NovaMediaHub\Models\Media ' )) {
9
+ if (! class_exists ('\Outl1ne\NovaMediaHub\Models\Media ' )) {
10
10
return '' ;
11
11
}
12
12
@@ -23,7 +23,7 @@ public function register($shortcode): string
23
23
});
24
24
25
25
foreach ($ images as $ key => $ image ) {
26
- $ images [$ key ]['src ' ] = $ image ->path . $ image ->file_name ;
26
+ $ images [$ key ]['src ' ] = $ image ->path . $ image ->file_name ;
27
27
$ images [$ key ]['title ' ] = $ image ['data ' ]['title ' ][0 ] ?? null ;
28
28
$ images [$ key ]['alt ' ] = $ image ['data ' ]['alt ' ][0 ] ?? null ;
29
29
}
@@ -46,11 +46,11 @@ public function register($shortcode): string
46
46
47
47
// Single image
48
48
$ media = \Outl1ne \NovaMediaHub \Models \Media::find ($ shortcode ->id );
49
- if (!$ media ) {
49
+ if (! $ media ) {
50
50
return '' ;
51
51
}
52
52
53
- $ path = $ media ->path . $ media ->file_name ;
53
+ $ path = $ media ->path . $ media ->file_name ;
54
54
$ align = $ shortcode ->align ?? null ;
55
55
$ link = $ shortcode ->link ? str_replace ("' " , '%27 ' , $ shortcode ->link ) : null ;
56
56
$ shape = $ shortcode ->shape ?? null ;
@@ -67,7 +67,7 @@ public function register($shortcode): string
67
67
if (is_array ($ credits )) {
68
68
$ credits = $ credits [0 ];
69
69
}
70
- $ alt = $ media ->data ['alt ' ] ?? 'Immagine id ' . $ shortcode ->id ;
70
+ $ alt = $ media ->data ['alt ' ] ?? 'Immagine id ' . $ shortcode ->id ;
71
71
if (is_array ($ alt )) {
72
72
$ alt = $ alt [0 ];
73
73
}
@@ -96,10 +96,10 @@ public function register($shortcode): string
96
96
public static function getImageHeight (string $ path , int $ width = 0 ): float |int
97
97
{
98
98
99
- $ localPath = storage_path ('app/public/ ' . $ path );
99
+ $ localPath = storage_path ('app/public/ ' . $ path );
100
100
101
101
// Check if file exists
102
- if (!file_exists ($ localPath )) {
102
+ if (! file_exists ($ localPath )) {
103
103
return 0 ;
104
104
}
105
105
0 commit comments