Passed
Push — master ( 99f62c...22c5d8 )
by Alex
07:13
created

Router::fetchActions()   A

Complexity

Conditions 4
Paths 4

Size

Total Lines 19
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 12
c 0
b 0
f 0
dl 0
loc 19
rs 9.8666
cc 4
nc 4
nop 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A Router::getCallback() 0 5 1
1
<?php
2
declare(strict_types = 1);
3
namespace Mezon\Router;
4
5
/**
6
 * Class Router
7
 *
8
 * @package Router
9
 * @author Dodonov A.A.
10
 * @version v.1.0 (2019/08/15)
11
 * @copyright Copyright (c) 2019, http://aeon.su
12
 */
13
14
/**
15
 * Router class
16
 */
17
class Router extends RouterBase implements RouterInterface
18
{
19
20
    use RoutesSet, UrlParser;
21
22
    /**
23
     *
24
     * {@inheritdoc}
25
     * @see RouterInterface::callRoute()
26
     * @psalm-suppress MixedAssignment
27
     */
28
    public function callRoute($route)
29
    {
30
        if (! $this->regExpsWereCompiled) {
31
            $this->compileRegexpForBunches();
32
        }
33
34
        return parent::callRoute($route);
35
    }
36
37
    /**
38
     * Method returns call back by it's router
39
     *
40
     * @param string[]|string $route
41
     *            route
42
     * @return array{0: string, 1: string}|callable|string|false route callback
43
     * @psalm-suppress MixedAssignment
44
     */
45
    public function getCallback($route)
46
    {
47
        $this->compileRegexpForBunches();
48
49
        return parent::getCallback($route);
50
    }
51
}
52