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

Route::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 5
cts 5
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 3
crap 1

1 Method

Rating   Name   Duplication   Size   Complexity  
Route::getMethod() 0 1 ?
1
<?php
2
declare(strict_types=1);
3
4
namespace Kambo\Router\Route;
5
6
/**
7
 * Route interface - all routes must implement this interface.
8
 *
9
 * @package Kambo\Router\Route
10
 * @author  Bohuslav Simek <[email protected]>
11
 * @license MIT
12
 */
13
interface Route
14
{
15
    /**
16
     * Sets route method
17
     *
18
     * @param string $method route method
19
     *
20
     * @return self for fluent interface
21
     */
22
    public function setMethod(string $method) : Route;
23
24
    /**
25
     * Get route method
26
     *
27
     * @return string
28
     */
29
    public function getMethod() : string;
30
31
    /**
32
     * Sets URL for route
33
     *
34
     * @param mixed $url route url
35
     *
36
     * @return self for fluent interface
37
     */
38
    public function setUrl(string $url) : Route;
39
40
    /**
41
     * Get URL of route
42
     *
43
     * @return string
44
     */
45
    public function getUrl() : string;
46
47
    /**
48
     * Sets handler that will be executed if the url will match the route.
49
     *
50
     * @param mixed $handler handler which will be executed if the url will
51
     *                       match the route
52
     *
53
     * @return self for fluent interface
54
     */
55
    public function setHandler($handler);
56
57
    /**
58
     * Get handler
59
     *
60
     * @return mixed
61
     */
62
    public function getHandler();
63
}
64