Skip to content

Commit 42aed73

Browse files
authored
Merge pull request #9 from timnarr/fix-support-php-8-4
fix: support PHP 8.4
2 parents 8952304 + 7368296 commit 42aed73

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

classes/Imagex.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ private function getFormats(): array
7676
* @param File|null $image Optional file object to determine format; defaults to main image.
7777
* @return string The image file format.
7878
*/
79-
private function getImageFormat(File $image = null): string
79+
private function getImageFormat(File|null $image = null): string
8080
{
8181
$image = $image ?? $this->image;
8282

@@ -123,7 +123,7 @@ private function getSrcsetPresetFromConfig(): array
123123
* @param File|null $image Optional file object; defaults to main image.
124124
* @return array Srcset preset with dynamic heights.
125125
*/
126-
private function getDynamicSrcsetPreset(string $ratio = null, File $image = null): array
126+
private function getDynamicSrcsetPreset(string|null $ratio = null, File|null $image = null): array
127127
{
128128
$srcsetPreset = $this->getSrcsetPresetFromConfig();
129129
['x' => $ratioX, 'y' => $ratioY] = getAspectRatio($ratio ?? $this->ratio, $image ?? $this->image);
@@ -148,7 +148,7 @@ private function getDynamicSrcsetPreset(string $ratio = null, File $image = null
148148
* @param File|null $image Optional file object; defaults to main image.
149149
* @return string Srcset value string.
150150
*/
151-
private function getSrcsetValue(array $srcsetPreset, File $image = null): string
151+
private function getSrcsetValue(array $srcsetPreset, File|null $image = null): string
152152
{
153153
$image = $image ?? $this->image;
154154

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
}
2222
],
2323
"require": {
24-
"php": "~8.1.0 || ~8.2.0 || ~8.3.0",
24+
"php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0",
2525
"getkirby/composer-installer": "^1.2"
2626
},
2727
"require-dev": {

helpers/misc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function normalizeFormat(string $format): string
2424
* @param string|null $siteUrl Optionally override the default site URL.
2525
* @return string The URL, potentially converted to a relative path.
2626
*/
27-
function urlHandler(string $url, bool $useRelativeUrls = null, string $siteUrl = null): string
27+
function urlHandler(string $url, bool|null $useRelativeUrls = null, string|null $siteUrl = null): string
2828
{
2929
$useRelativeUrls = $useRelativeUrls ?? kirby()->option('timnarr.imagex.relativeUrls');
3030
$siteUrl = $siteUrl ?? site()->url();

0 commit comments

Comments
 (0)