@@ -21,9 +21,9 @@ public function src(string $path, int $maxWidth = null, string $sizes = null): C
21
21
return $ attributes ;
22
22
}
23
23
24
- protected function getSrcAttribute (string $ path , int | null $ maxWidth ): string
24
+ protected function getSrcAttribute (string $ path , ? int $ maxWidth ): string
25
25
{
26
- if ( $ maxWidth === null ) {
26
+ if ($ maxWidth === null ) {
27
27
return asset ($ path );
28
28
}
29
29
@@ -37,7 +37,7 @@ protected function getSrcAttribute(string $path, int | null $maxWidth): string
37
37
]);
38
38
}
39
39
40
- protected function getSrcsetAttribute (string $ path , int | null $ maxWidth ): string
40
+ protected function getSrcsetAttribute (string $ path , ? int $ maxWidth ): string
41
41
{
42
42
$ scale = collect ([
43
43
400 ,
@@ -62,11 +62,11 @@ protected function getSrcsetAttribute(string $path, int | null $maxWidth): strin
62
62
$ scale = $ scale
63
63
->when ($ maxWidth )->reject (fn (int $ width ) => $ width > $ maxWidth )
64
64
// We will up-scale an image up to 2x it's original size. Above that it has no use anymore.
65
- ->when ($ imageWidth )->reject (fn (int $ width ) => $ width > ( $ imageWidth * 2 ));
65
+ ->when ($ imageWidth )->reject (fn (int $ width ) => $ width > ($ imageWidth * 2 ));
66
66
67
67
// Push a final version with exactly the correct max-width if the difference with the last item
68
68
// in the scale is bigger than 50px. Otherwise, the additional provided type is not so useful.
69
- if ( $ maxWidth && ( $ maxWidth - $ scale ->last () ) > 50 ) {
69
+ if ($ maxWidth && ($ maxWidth - $ scale ->last ()) > 50 ) {
70
70
$ scale ->push ($ maxWidth );
71
71
}
72
72
@@ -99,4 +99,4 @@ public function getCachePath(): string
99
99
{
100
100
return storage_path ('framework/cache/glide ' );
101
101
}
102
- }
102
+ }
0 commit comments