RouteFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A build() 0 4 1
1
<?php
2
/**
3
 * Factory which builds routes
4
 *
5
 * PHP version 5.5
6
 *
7
 * @category   OpCacheGUI
8
 * @package    Network
9
 * @author     Pieter Hordijk <[email protected]>
10
 * @copyright  Copyright (c) 2014 Pieter Hordijk <https://github.com/PeeHaa>
11
 * @license    http://www.opensource.org/licenses/mit-license.html  MIT License
12
 * @version    1.0.0
13
 */
14
namespace OpCacheGUI\Network;
15
16
/**
17
 * Factory which builds routes
18
 *
19
 * @category   OpCacheGUI
20
 * @package    Network
21
 * @author     Pieter Hordijk <[email protected]>
22
 */
23
class RouteFactory implements RouteBuilder
24
{
25
    /**
26
     * Creates the new route
27
     *
28
     * @param string   $identifier The identifier of this route
29
     * @param string   $verb       The verb of this route
30
     * @param callable $callback   The callback to execute when this route matches
31
     *
32
     * @return \OpCacheGUI\Network\Route
33
     */
34 1
    public function build($identifier, $verb, callable $callback)
35
    {
36 1
        return new Route($identifier, $verb, $callback);
37
    }
38
}
39