When   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A when() 0 10 2
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\Routines;
10
11
use Respect\Rest\Request;
12
13
/** Generic routine executed before route matching */
14
class When extends AbstractSyncedRoutine implements ProxyableWhen
15
{
16 5
    public function when(Request $request, $params)
0 ignored issues
show
Coding Style Best Practice introduced by
Please use __construct() instead of a PHP4-style constructor that is named after the class.
Loading history...
17
    {
18 5
        $valid = $this->execute($request, $params);
19
20 5
        if (!$valid) {
21 2
            header('HTTP/1.1 400');
22
        }
23
24 5
        return $valid;
25
    }
26
}
27