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

codeigniter4 / CodeIgniter4 / 12673986434

08 Jan 2025 03:42PM UTC coverage: 84.455% (+0.001%) from 84.454%
12673986434

Pull #9385

github

web-flow
Merge 06e47f0ee into e475fd8fa
Pull Request #9385: refactor: Fix phpstan expr.resultUnused

20699 of 24509 relevant lines covered (84.45%)

190.57 hits per line

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

30.77
/system/Exceptions/FrameworkException.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\Exceptions;
15

16
/**
17
 * Class FrameworkException
18
 *
19
 * A collection of exceptions thrown by the framework
20
 * that can only be determined at run time.
21
 */
22
class FrameworkException extends RuntimeException
23
{
24
    use DebugTraceableTrait;
25

26
    /**
27
     * @return static
28
     */
29
    public static function forEnabledZlibOutputCompression()
30
    {
31
        return new static(lang('Core.enabledZlibOutputCompression'));
×
32
    }
33

34
    /**
35
     * @return static
36
     */
37
    public static function forInvalidFile(string $path)
38
    {
39
        return new static(lang('Core.invalidFile', [$path]));
3✔
40
    }
41

42
    /**
43
     * @return static
44
     */
45
    public static function forInvalidDirectory(string $path)
46
    {
47
        return new static(lang('Core.invalidDirectory', [$path]));
1✔
48
    }
49

50
    /**
51
     * @return static
52
     */
53
    public static function forCopyError(string $path)
54
    {
55
        return new static(lang('Core.copyError', [$path]));
×
56
    }
57

58
    /**
59
     * @return static
60
     *
61
     * @deprecated 4.5.0 No longer used.
62
     */
63
    public static function forMissingExtension(string $extension)
64
    {
65
        if (str_contains($extension, 'intl')) {
×
66
            // @codeCoverageIgnoreStart
67
            $message = sprintf(
×
68
                'The framework needs the following extension(s) installed and loaded: %s.',
×
69
                $extension
×
70
            );
×
71
            // @codeCoverageIgnoreEnd
72
        } else {
73
            $message = lang('Core.missingExtension', [$extension]);
×
74
        }
75

76
        return new static($message);
×
77
    }
78

79
    /**
80
     * @return static
81
     */
82
    public static function forNoHandlers(string $class)
83
    {
84
        return new static(lang('Core.noHandlers', [$class]));
1✔
85
    }
86

87
    /**
88
     * @return static
89
     */
90
    public static function forFabricatorCreateFailed(string $table, string $reason)
91
    {
92
        return new static(lang('Fabricator.createFailed', [$table, $reason]));
1✔
93
    }
94
}
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