• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

codeigniter4 / CodeIgniter4 / 14588496992

22 Apr 2025 06:46AM UTC coverage: 84.37% (-0.03%) from 84.395%
14588496992

push

github

web-flow
feat: rewrite `ImageMagickHandler` to rely solely on the PHP `imagick` extension (#9526)

* feat: rewrite ImageMagickHandler to rely solely on the PHP imagick extension

* apply the code suggestions from the review

Co-authored-by: John Paul E. Balandan, CPA <paulbalandan@gmail.com>

---------

Co-authored-by: John Paul E. Balandan, CPA <paulbalandan@gmail.com>

152 of 171 new or added lines in 2 files covered. (88.89%)

7 existing lines in 3 files now uncovered.

20842 of 24703 relevant lines covered (84.37%)

190.79 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

40.0
/system/Images/Exceptions/ImageException.php
1
<?php
2

3
declare(strict_types=1);
4

5
/**
6
 * This file is part of CodeIgniter 4 framework.
7
 *
8
 * (c) CodeIgniter Foundation <admin@codeigniter.com>
9
 *
10
 * For the full copyright and license information, please view
11
 * the LICENSE file that was distributed with this source code.
12
 */
13

14
namespace CodeIgniter\Images\Exceptions;
15

16
use CodeIgniter\Exceptions\FrameworkException;
17

18
class ImageException extends FrameworkException
19
{
20
    /**
21
     * Thrown when the image is not found.
22
     *
23
     * @return static
24
     */
25
    public static function forMissingImage()
26
    {
27
        return new static(lang('Images.sourceImageRequired'));
1✔
28
    }
29

30
    /**
31
     * Thrown when the file specific is not following the role.
32
     *
33
     * @return static
34
     */
35
    public static function forFileNotSupported()
36
    {
37
        return new static(lang('Images.fileNotSupported'));
1✔
38
    }
39

40
    /**
41
     * Thrown when the angle is undefined.
42
     *
43
     * @return static
44
     */
45
    public static function forMissingAngle()
46
    {
47
        return new static(lang('Images.rotationAngleRequired'));
2✔
48
    }
49

50
    /**
51
     * Thrown when the direction property is invalid.
52
     *
53
     * @return static
54
     */
55
    public static function forInvalidDirection(?string $dir = null)
56
    {
57
        return new static(lang('Images.invalidDirection', [$dir]));
2✔
58
    }
59

60
    /**
61
     * Thrown when the path property is invalid.
62
     *
63
     * @return static
64
     */
65
    public static function forInvalidPath()
66
    {
67
        return new static(lang('Images.invalidPath'));
×
68
    }
69

70
    /**
71
     * Thrown when the EXIF function is not supported.
72
     *
73
     * @return static
74
     */
75
    public static function forEXIFUnsupported()
76
    {
77
        return new static(lang('Images.exifNotSupported'));
×
78
    }
79

80
    /**
81
     * Thrown when the image specific is invalid.
82
     *
83
     * @return static
84
     */
85
    public static function forInvalidImageCreate(?string $extra = null)
86
    {
87
        return new static(lang('Images.unsupportedImageCreate') . ' ' . $extra);
×
88
    }
89

90
    /**
91
     * Thrown when the image save failed.
92
     *
93
     * @return static
94
     */
95
    public static function forSaveFailed()
96
    {
97
        return new static(lang('Images.saveFailed'));
×
98
    }
99

100
    /**
101
     * Thrown when the image library path is invalid.
102
     *
103
     * @deprecated 4.7.0 No longer used.
104
     *
105
     * @return static
106
     */
107
    public static function forInvalidImageLibraryPath(?string $path = null)
108
    {
UNCOV
109
        return new static(lang('Images.libPathInvalid', [$path]));
×
110
    }
111

112
    /**
113
     * Thrown when the image process failed.
114
     *
115
     * @return static
116
     */
117
    public static function forImageProcessFailed()
118
    {
119
        return new static(lang('Images.imageProcessFailed'));
×
120
    }
121
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc