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

Matcher::match()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

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