Passed
Branch master (32ad63)
by Bohuslav
02:06
created

Base::build()   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 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 3
crap 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