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

Error::runTarget()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
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 Error extends Callback
12
{
13
    public $callback;
14
    public $errors = array();
15
16 1
    public function __construct($callback)
17
    {
18 1
        parent::__construct('ANY', '^$', $callback);
19 1
    }
20
21 1
    public function runTarget($method, &$params)
22
    {
23 1
        return call_user_func($this->callback, $this->errors);
24
    }
25
}
26