HttpRule   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
eloc 11
dl 0
loc 31
ccs 0
cts 13
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
A deprecated() 0 8 1
1
<?php
2
3
namespace Bavix\Router\Rules;
4
5
/**
6
 * Class HttpRule
7
 *
8
 * @package Bavix\Router\Rules
9
 *
10
 * @deprecated use PrefixRule
11
 * @since 2.0.0
12
 */
13
final class HttpRule extends PrefixRule
14
{
15
16
    /**
17
     * HttpRule constructor.
18
     *
19
     * @param string $key
20
     * @param array $storage
21
     * @param null $parent
0 ignored issues
show
Documentation Bug introduced by Babichev Maxim
Are you sure the doc-type for parameter $parent is correct as it would always require null to be passed?
Loading history...
22
     */
23
    public function __construct(string $key, array $storage, $parent = null)
24
    {
25
        \trigger_error(
26
            $this->deprecated(),
27
            \E_USER_DEPRECATED
28
        );
29
30
        parent::__construct($key, $storage, $parent);
31
    }
32
33
    /**
34
     * @return string
35
     */
36
    protected function deprecated(): string
37
    {
38
        return \sprintf(
39
            '%s: Type `%s` %s, use `%s`',
40
            __CLASS__,
41
            'http',
42
            __FUNCTION__,
43
            'prefix'
44
        );
45
    }
46
47
}
48