Completed
Push — master ( b3f98f...654a3a )
by Arman
20s queued 16s
created

RouteControllerException::controllerNotDefined()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * Quantum PHP Framework
5
 *
6
 * An open source software development framework for PHP
7
 *
8
 * @package Quantum
9
 * @author Arman Ag. <[email protected]>
10
 * @copyright Copyright (c) 2018 Softberg LLC (https://softberg.org)
11
 * @link http://quantum.softberg.org/
12
 * @since 2.9.7
13
 */
14
15
namespace Quantum\Router\Exceptions;
16
17
use Quantum\App\Exceptions\BaseException;
18
19
/**
20
 * ControllerException class
21
 * @package Quantum\Router
22
 */
23
class RouteControllerException extends BaseException
24
{
25
    /**
26
     * @param string|null $name
27
     * @return RouteControllerException
28
     */
29
    public static function controllerNotFound(?string $name): RouteControllerException
30
    {
31
        return new static(t('exception.controller_not_found', $name), E_ERROR);
32
    }
33
34
    /**
35
     * @param string|null $name
36
     * @return RouteControllerException
37
     */
38
    public static function controllerNotDefined(?string $name): RouteControllerException
39
    {
40
        return new static(t('exception.controller_not_defined', $name), E_ERROR);
41
    }
42
43
    /**
44
     * @param string $name
45
     * @return RouteControllerException
46
     */
47
    public static function actionNotDefined(string $name): RouteControllerException
48
    {
49
        return new static(t('exception.action_not_defined', $name), E_ERROR);
50
    }
51
52
    /**
53
     * @param string $name
54
     * @return RouteControllerException
55
     */
56
    public static function undefinedMethod(string $name): RouteControllerException
57
    {
58
        return new static(t('exception.undefined_method', $name), E_ERROR);
59
    }
60
}