Skip to content

Commit 1578fdc

Browse files
committed
Use new ImageType in phpdoc types
1 parent 7dec101 commit 1578fdc

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/Utils/Image.php

+9-9
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ public static function fromBlank(int $width, int $height, ?array $color = null):
249249

250250
/**
251251
* Returns the type of image from file.
252-
* @return self::JPEG|self::PNG|self::GIF|self::WEBP|self::AVIF|self::BMP|null
252+
* @return ImageType::*|null
253253
*/
254254
public static function detectTypeFromFile(string $file, &$width = null, &$height = null): ?int
255255
{
@@ -260,7 +260,7 @@ public static function detectTypeFromFile(string $file, &$width = null, &$height
260260

261261
/**
262262
* Returns the type of image from string.
263-
* @return self::JPEG|self::PNG|self::GIF|self::WEBP|self::AVIF|self::BMP|null
263+
* @return ImageType::*|null
264264
*/
265265
public static function detectTypeFromString(string $s, &$width = null, &$height = null): ?int
266266
{
@@ -271,7 +271,7 @@ public static function detectTypeFromString(string $s, &$width = null, &$height
271271

272272
/**
273273
* Returns the file extension for the given `Image::XXX` constant.
274-
* @param self::JPEG|self::PNG|self::GIF|self::WEBP|self::AVIF|self::BMP $type
274+
* @param ImageType::* $type
275275
* @return value-of<self::Formats>
276276
*/
277277
public static function typeToExtension(int $type): string
@@ -286,7 +286,7 @@ public static function typeToExtension(int $type): string
286286

287287
/**
288288
* Returns the `Image::XXX` constant for given file extension.
289-
* @return self::JPEG|self::PNG|self::GIF|self::WEBP|self::AVIF|self::BMP
289+
* @return ImageType::*
290290
*/
291291
public static function extensionToType(string $extension): int
292292
{
@@ -302,7 +302,7 @@ public static function extensionToType(string $extension): int
302302

303303
/**
304304
* Returns the mime type for the given `Image::XXX` constant.
305-
* @param self::JPEG|self::PNG|self::GIF|self::WEBP|self::AVIF|self::BMP $type
305+
* @param ImageType::* $type
306306
*/
307307
public static function typeToMimeType(int $type): string
308308
{
@@ -606,7 +606,7 @@ public function place(self $image, int|string $left = 0, int|string $top = 0, in
606606

607607
/**
608608
* Saves image to the file. Quality is in the range 0..100 for JPEG (default 85), WEBP (default 80) and AVIF (default 30) and 0..9 for PNG (default 9).
609-
* @param self::JPEG|self::PNG|self::GIF|self::WEBP|self::AVIF|self::BMP|null $type
609+
* @param ImageType::*|null $type
610610
* @throws ImageException
611611
*/
612612
public function save(string $file, ?int $quality = null, ?int $type = null): void
@@ -618,7 +618,7 @@ public function save(string $file, ?int $quality = null, ?int $type = null): voi
618618

619619
/**
620620
* Outputs image to string. Quality is in the range 0..100 for JPEG (default 85), WEBP (default 80) and AVIF (default 30) and 0..9 for PNG (default 9).
621-
* @param self::JPEG|self::PNG|self::GIF|self::WEBP|self::AVIF|self::BMP $type
621+
* @param ImageType::* $type
622622
*/
623623
public function toString(int $type = ImageType::JPEG, ?int $quality = null): string
624624
{
@@ -639,7 +639,7 @@ public function __toString(): string
639639

640640
/**
641641
* Outputs image to browser. Quality is in the range 0..100 for JPEG (default 85), WEBP (default 80) and AVIF (default 30) and 0..9 for PNG (default 9).
642-
* @param self::JPEG|self::PNG|self::GIF|self::WEBP|self::AVIF|self::BMP $type
642+
* @param ImageType::* $type
643643
* @throws ImageException
644644
*/
645645
public function send(int $type = ImageType::JPEG, ?int $quality = null): void
@@ -652,7 +652,7 @@ public function send(int $type = ImageType::JPEG, ?int $quality = null): void
652652
/**
653653
* Outputs image to browser or file.
654654
* @throws ImageException
655-
* @param self::JPEG|self::PNG|self::GIF|self::WEBP|self::AVIF|self::BMP $type
655+
* @param ImageType::* $type
656656
*/
657657
private function output(int $type, ?int $quality, ?string $file = null): void
658658
{

0 commit comments

Comments
 (0)