Skip to content

Commit 7ecc708

Browse files
committed
Dev: Define the image exception.
1 parent eac79d8 commit 7ecc708

File tree

1 file changed

+60
-10
lines changed

1 file changed

+60
-10
lines changed

system/Images/Exceptions/ImageException.php

Lines changed: 60 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,52 +16,102 @@
1616

1717
class ImageException extends FrameworkException implements ExceptionInterface
1818
{
19-
public static function forMissingImage(): self
19+
/**
20+
* Thrown when the image is not found.
21+
*
22+
* @return static
23+
*/
24+
public static function forMissingImage()
2025
{
2126
return new static(lang('Images.sourceImageRequired'));
2227
}
2328

24-
public static function forFileNotSupported(): self
29+
/**
30+
* Thrown when the file specific is not following the role.
31+
*
32+
* @return static
33+
*/
34+
public static function forFileNotSupported()
2535
{
2636
return new static(lang('Images.fileNotSupported'));
2737
}
2838

29-
public static function forMissingAngle(): self
39+
/**
40+
* Thrown when the angle is undefined.
41+
*
42+
* @return static
43+
*/
44+
public static function forMissingAngle()
3045
{
3146
return new static(lang('Images.rotationAngleRequired'));
3247
}
3348

34-
public static function forInvalidDirection(?string $dir = null): self
49+
/**
50+
* Thrown when the direction property is invalid.
51+
*
52+
* @return static
53+
*/
54+
public static function forInvalidDirection(?string $dir = null)
3555
{
3656
return new static(lang('Images.invalidDirection', [$dir]));
3757
}
3858

39-
public static function forInvalidPath(): self
59+
/**
60+
* Thrown when the path property is invalid.
61+
*
62+
* @return static
63+
*/
64+
public static function forInvalidPath()
4065
{
4166
return new static(lang('Images.invalidPath'));
4267
}
4368

44-
public static function forEXIFUnsupported(): self
69+
/**
70+
* Thrown when the EXIF function is not supported.
71+
*
72+
* @return static
73+
*/
74+
public static function forEXIFUnsupported()
4575
{
4676
return new static(lang('Images.exifNotSupported'));
4777
}
4878

49-
public static function forInvalidImageCreate(?string $extra = null): self
79+
/**
80+
* Thrown when the image specific is invalid.
81+
*
82+
* @return static
83+
*/
84+
public static function forInvalidImageCreate(?string $extra = null)
5085
{
5186
return new static(lang('Images.unsupportedImageCreate') . ' ' . $extra);
5287
}
5388

54-
public static function forSaveFailed(): self
89+
/**
90+
* Thrown when the image save failed.
91+
*
92+
* @return static
93+
*/
94+
public static function forSaveFailed()
5595
{
5696
return new static(lang('Images.saveFailed'));
5797
}
5898

59-
public static function forInvalidImageLibraryPath(?string $path = null): self
99+
/**
100+
* Thrown when the image library path is invalid.
101+
*
102+
* @return static
103+
*/
104+
public static function forInvalidImageLibraryPath(?string $path = null)
60105
{
61106
return new static(lang('Images.libPathInvalid', [$path]));
62107
}
63108

64-
public static function forImageProcessFailed(): self
109+
/**
110+
* Thrown when the image process failed.
111+
*
112+
* @return static
113+
*/
114+
public static function forImageProcessFailed()
65115
{
66116
return new static(lang('Images.imageProcessFailed'));
67117
}

0 commit comments

Comments
 (0)