Completed
Push — master ( d34cec...faecd8 )
by Augusto
02:22
created

Exception::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 2
crap 1
1
<?php
2
/*
3
 * This file is part of the Respect\Rest package.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
9
namespace Respect\Rest\Routes;
10
11
class Exception extends Callback
12
{
13
    public $class;
14
    public $callback;
15
    public $exception;
16
17 1
    public function __construct($class, $callback)
18
    {
19 1
        $this->class = $class;
20 1
        parent::__construct('ANY', '^$', $callback);
21 1
    }
22
23 1
    public function runTarget($method, &$params)
24
    {
25 1
        return call_user_func($this->callback, $this->exception);
26
    }
27
}
28