Dispatcher
last analyzed

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 28
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
dispatchRoute() 0 1 ?
dispatchNotFound() 0 1 ?
setNotFoundHandler() 0 1 ?
1
<?php
2
declare(strict_types=1);
3
4
namespace Kambo\Router;
5
6
use Kambo\Router\Route\Route\Parsed;
7
8
/**
9
 * Interface for dispatcher
10
 *
11
 * @package Kambo\Router
12
 * @author  Bohuslav Simek <[email protected]>
13
 * @license MIT
14
 */
15
interface Dispatcher
16
{
17
    /**
18
     * Dispatch found route with given parameters
19
     *
20
     * @param \Kambo\Router\Route\Route\Parsed $route      Instance of found and parsed route.
21
     * @param array                            $parameters Additional parameters, which will passed into dispatcher.
22
     *
23
     * @return mixed
24
     */
25
    public function dispatchRoute(Parsed $route, array $parameters = []);
26
27
    /**
28
     * Called if any of route did not match the request.
29
     *
30
     * @return mixed
31
     */
32
    public function dispatchNotFound();
33
34
    /**
35
     * Sets not found handler
36
     *
37
     * @param ParsedRoute $route Instance of found parsed route
0 ignored issues
show
Bug introduced by
There is no parameter named $route. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
38
     *
39
     * @return self for fluent interface
40
     */
41
    public function setNotFoundHandler($handler);
42
}
43