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

codeigniter4 / CodeIgniter4 / 8677009716

13 Apr 2024 11:45PM UTC coverage: 84.44% (-2.2%) from 86.607%
8677009716

push

github

web-flow
Merge pull request #8776 from kenjis/fix-findQualifiedNameFromPath-Cannot-declare-class-v3

fix: Cannot declare class CodeIgniter\Config\Services, because the name is already in use

0 of 3 new or added lines in 1 file covered. (0.0%)

478 existing lines in 72 files now uncovered.

20318 of 24062 relevant lines covered (84.44%)

188.23 hits per line

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

75.0
/system/Format/Exceptions/FormatException.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\Format\Exceptions;
15

16
use CodeIgniter\Exceptions\DebugTraceableTrait;
17
use CodeIgniter\Exceptions\ExceptionInterface;
18
use RuntimeException;
19

20
/**
21
 * FormatException
22
 */
23
class FormatException extends RuntimeException implements ExceptionInterface
24
{
25
    use DebugTraceableTrait;
26

27
    /**
28
     * Thrown when the instantiated class does not exist.
29
     *
30
     * @return static
31
     */
32
    public static function forInvalidFormatter(string $class)
33
    {
34
        return new static(lang('Format.invalidFormatter', [$class]));
2✔
35
    }
36

37
    /**
38
     * Thrown in JSONFormatter when the json_encode produces
39
     * an error code other than JSON_ERROR_NONE and JSON_ERROR_RECURSION.
40
     *
41
     * @param string $error The error message
42
     *
43
     * @return static
44
     */
45
    public static function forInvalidJSON(?string $error = null)
46
    {
47
        return new static(lang('Format.invalidJSON', [$error]));
1✔
48
    }
49

50
    /**
51
     * Thrown when the supplied MIME type has no
52
     * defined Formatter class.
53
     *
54
     * @return static
55
     */
56
    public static function forInvalidMime(string $mime)
57
    {
58
        return new static(lang('Format.invalidMime', [$mime]));
1✔
59
    }
60

61
    /**
62
     * Thrown on XMLFormatter when the `simplexml` extension
63
     * is not installed.
64
     *
65
     * @return static
66
     *
67
     * @codeCoverageIgnore
68
     */
69
    public static function forMissingExtension()
70
    {
UNCOV
71
        return new static(lang('Format.missingExtension'));
×
72
    }
73
}
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