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

Matcher::matchRoute()   B

Complexity

Conditions 5
Paths 4

Size

Total Lines 17
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 13
CRAP Score 5

Importance

Changes 0
Metric Value
dl 0
loc 17
ccs 13
cts 13
cp 1
rs 8.8571
c 0
b 0
f 0
cc 5
eloc 11
nc 4
nop 2
crap 5
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