Test Failed
Branch develop (ab83c3)
by Bohuslav
02:47
created

Matcher::transformRoute()   B

Complexity

Conditions 4
Paths 2

Size

Total Lines 26
Code Lines 17

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 19
CRAP Score 4

Importance

Changes 0
Metric Value
dl 0
loc 26
ccs 19
cts 19
cp 1
rs 8.5806
c 0
b 0
f 0
cc 4
eloc 17
nc 2
nop 1
crap 4
1
<?php
2
3
namespace Kambo\Router;
4
5
// \Psr\Http\Message
6
use Psr\Http\Message\ServerRequestInterface as ServerRequest;
7
8
/**
9
 * Match provided request object with all defined routes in route collection.
10
 * If some of routes match a data in provided request An instance of matched
11
 * parsed route is returned. If nothing is matched false value is returned.
12
 *
13
 * @package Kambo\Router
14
 * @author  Bohuslav Simek <[email protected]>
15
 * @license MIT
16
 */
17
interface Matcher
18
{
19
    /**
20
     * Match request with provided routes.
21
     * Get method and url from provided request and start matching.
22
     *
23
     * @param ServerRequest $request instance of PSR 7 compatible request object
24
     *
25
     * @return mixed
26
     */
27
    public function matchRequest($request);
28
29
    /**
30
     * Match url and method with provided routes.
31
     *
32
     * @param string $method http method
33
     * @param string $url    url
34
     *
35
     * @return mixed
36
     */
37
    public function matchPathAndMethod($method, $url);
38
}
39