@@ -331,7 +331,7 @@ public function fromString(string $string): SimpleImage|static
331
331
*
332
332
* @throws Exception Thrown when WEBP support is not enabled or unsupported format.
333
333
*/
334
- public function generate (string $ mimeType = null , array |int $ options = 100 ): array
334
+ public function generate (string | null $ mimeType = null , array |int $ options = 100 ): array
335
335
{
336
336
// Format defaults to the original mime type
337
337
$ mimeType = $ mimeType ?: $ this ->mimeType ;
@@ -473,7 +473,7 @@ public function generate(string $mimeType = null, array|int $options = 100): arr
473
473
*
474
474
* @throws Exception
475
475
*/
476
- public function toDataUri (string $ mimeType = null , array |int $ options = 100 ): string
476
+ public function toDataUri (string | null $ mimeType = null , array |int $ options = 100 ): string
477
477
{
478
478
$ image = $ this ->generate ($ mimeType , $ options );
479
479
@@ -490,7 +490,7 @@ public function toDataUri(string $mimeType = null, array|int $options = 100): st
490
490
*
491
491
* @throws Exception
492
492
*/
493
- public function toDownload (string $ filename , string $ mimeType = null , array |int $ options = 100 ): static
493
+ public function toDownload (string $ filename , string | null $ mimeType = null , array |int $ options = 100 ): static
494
494
{
495
495
$ image = $ this ->generate ($ mimeType , $ options );
496
496
@@ -517,7 +517,7 @@ public function toDownload(string $filename, string $mimeType = null, array|int
517
517
*
518
518
* @throws Exception Thrown if failed write to file.
519
519
*/
520
- public function toFile (string $ file , string $ mimeType = null , array |int $ options = 100 ): static
520
+ public function toFile (string $ file , string | null $ mimeType = null , array |int $ options = 100 ): static
521
521
{
522
522
$ image = $ this ->generate ($ mimeType , $ options );
523
523
@@ -538,7 +538,7 @@ public function toFile(string $file, string $mimeType = null, array|int $options
538
538
*
539
539
* @throws Exception
540
540
*/
541
- public function toScreen (string $ mimeType = null , array |int $ options = 100 ): static
541
+ public function toScreen (string | null $ mimeType = null , array |int $ options = 100 ): static
542
542
{
543
543
$ image = $ this ->generate ($ mimeType , $ options );
544
544
@@ -557,7 +557,7 @@ public function toScreen(string $mimeType = null, array|int $options = 100): sta
557
557
*
558
558
* @throws Exception
559
559
*/
560
- public function toString (string $ mimeType = null , array |int $ options = 100 ): string
560
+ public function toString (string | null $ mimeType = null , array |int $ options = 100 ): string
561
561
{
562
562
return $ this ->generate ($ mimeType , $ options )['data ' ];
563
563
}
@@ -975,7 +975,7 @@ public function overlay(string|SimpleImage $overlay, string $anchor = 'center',
975
975
* @param int|null $height The new image height.
976
976
* @return SimpleImage
977
977
*/
978
- public function resize (int $ width = null , int $ height = null ): static
978
+ public function resize (int | null $ width = null , int | null $ height = null ): static
979
979
{
980
980
// No dimensions specified
981
981
if (! $ width && ! $ height ) {
@@ -1027,7 +1027,7 @@ public function resize(int $width = null, int $height = null): static
1027
1027
* @param int|null $res_y The vertical resolution in DPI
1028
1028
* @return SimpleImage
1029
1029
*/
1030
- public function resolution (int $ res_x , int $ res_y = null ): static
1030
+ public function resolution (int $ res_x , int | null $ res_y = null ): static
1031
1031
{
1032
1032
if (is_null ($ res_y )) {
1033
1033
imageresolution ($ this ->image , $ res_x );
@@ -1087,7 +1087,7 @@ public function rotate(int $angle, string|array $backgroundColor = 'transparent'
1087
1087
*
1088
1088
* @throws Exception
1089
1089
*/
1090
- public function text (string $ text , array $ options , array &$ boundary = null ): static
1090
+ public function text (string $ text , array $ options , array | null &$ boundary = null ): static
1091
1091
{
1092
1092
// Check for freetype support
1093
1093
if (! function_exists ('imagettftext ' )) {
@@ -2196,7 +2196,7 @@ public static function darkenColor(string|array $color, int $amount): array
2196
2196
*
2197
2197
* @throws Exception Thrown if library \League\ColorExtractor is missing.
2198
2198
*/
2199
- public function extractColors (int $ count = 5 , string |array $ backgroundColor = null ): array
2199
+ public function extractColors (int $ count = 5 , string |array | null $ backgroundColor = null ): array
2200
2200
{
2201
2201
// Check for required library
2202
2202
if (! class_exists ('\\' .ColorExtractor::class)) {
0 commit comments