Skip to content

Commit 8e42ddf

Browse files
committed
Dev: Add the return type of image exception.
1 parent 5435ea3 commit 8e42ddf

2 files changed

Lines changed: 10 additions & 60 deletions

File tree

phpstan-baseline.php

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1366,56 +1366,6 @@
13661366
'count' => 1,
13671367
'path' => __DIR__ . '/system/I18n/TimeLegacy.php',
13681368
];
1369-
$ignoreErrors[] = [
1370-
'message' => '#^Method CodeIgniter\\\\Images\\\\Exceptions\\\\ImageException\\:\\:forEXIFUnsupported\\(\\) has no return type specified\\.$#',
1371-
'count' => 1,
1372-
'path' => __DIR__ . '/system/Images/Exceptions/ImageException.php',
1373-
];
1374-
$ignoreErrors[] = [
1375-
'message' => '#^Method CodeIgniter\\\\Images\\\\Exceptions\\\\ImageException\\:\\:forFileNotSupported\\(\\) has no return type specified\\.$#',
1376-
'count' => 1,
1377-
'path' => __DIR__ . '/system/Images/Exceptions/ImageException.php',
1378-
];
1379-
$ignoreErrors[] = [
1380-
'message' => '#^Method CodeIgniter\\\\Images\\\\Exceptions\\\\ImageException\\:\\:forImageProcessFailed\\(\\) has no return type specified\\.$#',
1381-
'count' => 1,
1382-
'path' => __DIR__ . '/system/Images/Exceptions/ImageException.php',
1383-
];
1384-
$ignoreErrors[] = [
1385-
'message' => '#^Method CodeIgniter\\\\Images\\\\Exceptions\\\\ImageException\\:\\:forInvalidDirection\\(\\) has no return type specified\\.$#',
1386-
'count' => 1,
1387-
'path' => __DIR__ . '/system/Images/Exceptions/ImageException.php',
1388-
];
1389-
$ignoreErrors[] = [
1390-
'message' => '#^Method CodeIgniter\\\\Images\\\\Exceptions\\\\ImageException\\:\\:forInvalidImageCreate\\(\\) has no return type specified\\.$#',
1391-
'count' => 1,
1392-
'path' => __DIR__ . '/system/Images/Exceptions/ImageException.php',
1393-
];
1394-
$ignoreErrors[] = [
1395-
'message' => '#^Method CodeIgniter\\\\Images\\\\Exceptions\\\\ImageException\\:\\:forInvalidImageLibraryPath\\(\\) has no return type specified\\.$#',
1396-
'count' => 1,
1397-
'path' => __DIR__ . '/system/Images/Exceptions/ImageException.php',
1398-
];
1399-
$ignoreErrors[] = [
1400-
'message' => '#^Method CodeIgniter\\\\Images\\\\Exceptions\\\\ImageException\\:\\:forInvalidPath\\(\\) has no return type specified\\.$#',
1401-
'count' => 1,
1402-
'path' => __DIR__ . '/system/Images/Exceptions/ImageException.php',
1403-
];
1404-
$ignoreErrors[] = [
1405-
'message' => '#^Method CodeIgniter\\\\Images\\\\Exceptions\\\\ImageException\\:\\:forMissingAngle\\(\\) has no return type specified\\.$#',
1406-
'count' => 1,
1407-
'path' => __DIR__ . '/system/Images/Exceptions/ImageException.php',
1408-
];
1409-
$ignoreErrors[] = [
1410-
'message' => '#^Method CodeIgniter\\\\Images\\\\Exceptions\\\\ImageException\\:\\:forMissingImage\\(\\) has no return type specified\\.$#',
1411-
'count' => 1,
1412-
'path' => __DIR__ . '/system/Images/Exceptions/ImageException.php',
1413-
];
1414-
$ignoreErrors[] = [
1415-
'message' => '#^Method CodeIgniter\\\\Images\\\\Exceptions\\\\ImageException\\:\\:forSaveFailed\\(\\) has no return type specified\\.$#',
1416-
'count' => 1,
1417-
'path' => __DIR__ . '/system/Images/Exceptions/ImageException.php',
1418-
];
14191369
$ignoreErrors[] = [
14201370
'message' => '#^Property CodeIgniter\\\\Images\\\\Handlers\\\\BaseHandler\\:\\:\\$image \\(CodeIgniter\\\\Images\\\\Image\\) in empty\\(\\) is not falsy\\.$#',
14211371
'count' => 1,

system/Images/Exceptions/ImageException.php

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

1717
class ImageException extends FrameworkException implements ExceptionInterface
1818
{
19-
public static function forMissingImage()
19+
public static function forMissingImage(): ImageException
2020
{
2121
return new static(lang('Images.sourceImageRequired'));
2222
}
2323

24-
public static function forFileNotSupported()
24+
public static function forFileNotSupported(): ImageException
2525
{
2626
return new static(lang('Images.fileNotSupported'));
2727
}
2828

29-
public static function forMissingAngle()
29+
public static function forMissingAngle(): ImageException
3030
{
3131
return new static(lang('Images.rotationAngleRequired'));
3232
}
3333

34-
public static function forInvalidDirection(?string $dir = null)
34+
public static function forInvalidDirection(?string $dir = null): ImageException
3535
{
3636
return new static(lang('Images.invalidDirection', [$dir]));
3737
}
3838

39-
public static function forInvalidPath()
39+
public static function forInvalidPath(): ImageException
4040
{
4141
return new static(lang('Images.invalidPath'));
4242
}
4343

44-
public static function forEXIFUnsupported()
44+
public static function forEXIFUnsupported(): ImageException
4545
{
4646
return new static(lang('Images.exifNotSupported'));
4747
}
4848

49-
public static function forInvalidImageCreate(?string $extra = null)
49+
public static function forInvalidImageCreate(?string $extra = null): ImageException
5050
{
5151
return new static(lang('Images.unsupportedImageCreate') . ' ' . $extra);
5252
}
5353

54-
public static function forSaveFailed()
54+
public static function forSaveFailed(): ImageException
5555
{
5656
return new static(lang('Images.saveFailed'));
5757
}
5858

59-
public static function forInvalidImageLibraryPath(?string $path = null)
59+
public static function forInvalidImageLibraryPath(?string $path = null): ImageException
6060
{
6161
return new static(lang('Images.libPathInvalid', [$path]));
6262
}
6363

64-
public static function forImageProcessFailed()
64+
public static function forImageProcessFailed(): ImageException
6565
{
6666
return new static(lang('Images.imageProcessFailed'));
6767
}

0 commit comments

Comments
 (0)