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

codeigniter4 / CodeIgniter4 / 21568681844

01 Feb 2026 07:16PM UTC coverage: 85.41% (+1.0%) from 84.387%
21568681844

push

github

web-flow
Merge pull request #9916 from codeigniter4/4.7

4.7.0 Merge code

1603 of 1888 new or added lines in 101 files covered. (84.9%)

31 existing lines in 11 files now uncovered.

22163 of 25949 relevant lines covered (85.41%)

205.52 hits per line

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

80.0
/system/API/ApiException.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\API;
15

16
use CodeIgniter\Exceptions\FrameworkException;
17

18
/**
19
 * Custom exception for API-related errors.
20
 */
21
final class ApiException extends FrameworkException
22
{
23
    /**
24
     * Thrown when the fields requested in a URL are not valid.
25
     */
26
    public static function forInvalidFields(string $field): self
27
    {
28
        return new self(lang('Api.invalidFields', [$field]));
1✔
29
    }
30

31
    /**
32
     * Thrown when the includes requested in a URL are not valid.
33
     */
34
    public static function forInvalidIncludes(string $include): self
35
    {
NEW
36
        return new self(lang('Api.invalidIncludes', [$include]));
×
37
    }
38

39
    /**
40
     * Thrown when an include is requested, but the method to handle it
41
     * does not exist on the model.
42
     */
43
    public static function forMissingInclude(string $include): self
44
    {
45
        return new self(lang('Api.missingInclude', [$include]));
4✔
46
    }
47

48
    /**
49
     * Thrown when a transformer class cannot be found.
50
     */
51
    public static function forTransformerNotFound(string $transformerClass): self
52
    {
53
        return new self(lang('Api.transformerNotFound', [$transformerClass]));
1✔
54
    }
55

56
    /**
57
     * Thrown when a transformer class does not implement TransformerInterface.
58
     */
59
    public static function forInvalidTransformer(string $transformerClass): self
60
    {
61
        return new self(lang('Api.invalidTransformer', [$transformerClass]));
1✔
62
    }
63
}
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

© 2026 Coveralls, Inc