Passed
Push — master ( ce3630...62e080 )
by Php Easy Api
02:42
created

ExceptionManager::badMethodCall()   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
namespace Resta\Exception;
4
5
use LogicException;
6
use RangeException;
7
use DomainException;
8
use LengthException;
9
use RuntimeException;
10
use OverflowException;
11
use UnderflowException;
12
use OutOfRangeException;
13
use BadMethodCallException;
14
use UnexpectedValueException;
15
use BadFunctionCallException;
16
use InvalidArgumentException;
17
use Resta\Contracts\ExceptionContracts;
18
19
class ExceptionManager extends ExceptionTrace implements ExceptionContracts
20
{
21
    /**
22
     * invalid argument exception
23
     *
24
     * @param null|string $msg
25
     */
26
    public function invalidArgument($msg=null)
27
    {
28
        throw new InvalidArgumentException($msg);
29
    }
30
31
    /**
32
     * bad function call exception
33
     *
34
     * @param null|string $msg
35
     */
36
    public function badFunctionCall($msg=null)
37
    {
38
        throw new BadFunctionCallException($msg);
39
    }
40
41
    /**
42
     * bad method call
43
     *
44
     * @param null|string $msg
45
     */
46
    public function badMethodCall($msg=null)
47
    {
48
        throw new BadMethodCallException($msg);
49
    }
50
51
    /**
52
     * domain exception
53
     *
54
     * @param null|string $msg
55
     */
56
    public function domain($msg=null)
57
    {
58
        throw new DomainException($msg);
59
    }
60
61
    /**
62
     * length exception
63
     *
64
     * @param null|string $msg
65
     */
66
    public function length($msg=null)
67
    {
68
        throw new LengthException($msg);
69
    }
70
71
    /**
72
     * logic exception
73
     *
74
     * @param null|string $msg
75
     */
76
    public function logic($msg=null)
77
    {
78
        throw new LogicException($msg);
79
    }
80
81
    /**
82
     * not found exception
83
     *
84
     * @throws NotFoundException
85
     */
86
    public function notFoundException()
87
    {
88
        throw new NotFoundException;
89
    }
90
91
    /**
92
     * out of range exception
93
     *
94
     * @param null|string $msg
95
     */
96
    public function outOfRange($msg=null)
97
    {
98
        throw new OutOfRangeException($msg);
99
    }
100
101
    /**
102
     * overflow exception
103
     *
104
     * @param null|string $msg
105
     */
106
    public function overflow($msg=null)
107
    {
108
        throw new OverflowException($msg);
109
    }
110
111
    /**
112
     * range exception
113
     *
114
     * @param null|string $msg
115
     */
116
    public function range($msg=null)
117
    {
118
        throw new RangeException($msg);
119
    }
120
121
    /**
122
     * runtime exception
123
     *
124
     * @param null|string $msg
125
     */
126
    public function runtime($msg=null)
127
    {
128
        throw new RuntimeException($msg);
129
    }
130
131
    /**
132
     * underflow exception
133
     *
134
     * @param null|string $msg
135
     */
136
    public function underflow($msg=null)
137
    {
138
        throw new UnderflowException($msg);
139
    }
140
141
    /**
142
     * unexpexted value exception
143
     *
144
     * @param null|string $msg
145
     */
146
    public function unexpectedValue($msg=null)
147
    {
148
        throw new UnexpectedValueException($msg);
149
    }
150
}