Base   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
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 17
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
declare(strict_types=1);
3
4
namespace Kambo\Router\Route\Builder;
5
6
use Kambo\Router\Route\Builder;
7
use Kambo\Router\Route\Route\Base as BaseRoute;
8
use Kambo\Router\Route\Route;
9
10
/**
11
 * Build instance of the base route
12
 *
13
 * @package Kambo\Router\Route
14
 * @author  Bohuslav Simek <[email protected]>
15
 * @license MIT
16
 */
17
class Base implements Builder
18
{
19
    /**
20
     * Build instance of the route
21
     *
22
     * @param string $method  Route method - GET, POST, etc...
23
     * @param string $url     route definition
24
     * @param mixed  $handler handler which will be executed if the url match
25
     *                        the route
26
     *
27
     * @return \Kambo\Router\Route\Route\Base Base route
28
     */
29 42
    public function build(string $method, string $url, $handler) : Route
30
    {
31 42
        return new BaseRoute($method, $url, $handler);
32
    }
33
}
34