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

codeigniter4 / CodeIgniter4 / 18327246865

07 Oct 2025 09:54PM UTC coverage: 84.318% (-0.007%) from 84.325%
18327246865

Pull #9749

github

web-flow
Merge e7c65af30 into 3473349b6
Pull Request #9749: feat(app): Allow turning off defined routes and/or auto routing

48 of 52 new or added lines in 5 files covered. (92.31%)

4 existing lines in 1 file now uncovered.

21125 of 25054 relevant lines covered (84.32%)

194.63 hits per line

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

71.43
/system/Router/Exceptions/RouterException.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\Router\Exceptions;
15

16
use CodeIgniter\Exceptions\FrameworkException;
17

18
/**
19
 * RouterException
20
 */
21
class RouterException extends FrameworkException implements ExceptionInterface
22
{
23
    /**
24
     * Thrown when the actual parameter type does not match
25
     * the expected types.
26
     *
27
     * @return RouterException
28
     */
29
    public static function forInvalidParameterType()
30
    {
31
        return new static(lang('Router.invalidParameterType'));
1✔
32
    }
33

34
    /**
35
     * Thrown when a default route is not set.
36
     *
37
     * @return RouterException
38
     */
39
    public static function forMissingDefaultRoute()
40
    {
41
        return new static(lang('Router.missingDefaultRoute'));
×
42
    }
43

44
    /**
45
     * Throw when controller or its method is not found.
46
     *
47
     * @return RouterException
48
     */
49
    public static function forControllerNotFound(string $controller, string $method)
50
    {
51
        return new static(lang('HTTP.controllerNotFound', [$controller, $method]));
1✔
52
    }
53

54
    /**
55
     * Throw when route is not valid.
56
     *
57
     * @return RouterException
58
     */
59
    public static function forInvalidRoute(string $route)
60
    {
61
        return new static(lang('HTTP.invalidRoute', [$route]));
1✔
62
    }
63

64
    /**
65
     * Throw when dynamic controller.
66
     *
67
     * @return RouterException
68
     */
69
    public static function forDynamicController(string $handler)
70
    {
71
        return new static(lang('Router.invalidDynamicController', [$handler]));
1✔
72
    }
73

74
    /**
75
     * Throw when controller name has `/`.
76
     *
77
     * @return RouterException
78
     */
79
    public static function forInvalidControllerName(string $handler)
80
    {
81
        return new static(lang('Router.invalidControllerName', [$handler]));
1✔
82
    }
83

84
    /**
85
     * Throw when no routing is available (both autoRoute and definedRoutes are false).
86
     */
87
    public static function forNoRoutingAvailable(): self
88
    {
NEW
89
        return new static(lang('Router.noRoutingAvailable'));
×
90
    }
91
}
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