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

Error   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 2
c 3
b 0
f 0
lcom 1
cbo 1
dl 0
loc 15
ccs 5
cts 5
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A runTarget() 0 4 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