Passed
Push — master ( 65b336...1323cd )
by Бабичев
44s
created

HttpRule   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 32
ccs 0
cts 12
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
     * @return string
18
     */
19
    protected function deprecated(): string
20
    {
21
        return \sprintf(
22
            '%s: Type `%s` %s, use `%s`',
23
            __CLASS__,
24
            'http',
25
            __FUNCTION__,
26
            'prefix'
27
        );
28
    }
29
30
    /**
31
     * HttpRule constructor.
32
     *
33
     * @param string $key
34
     * @param array  $storage
35
     * @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...
36
     */
37
    public function __construct(string $key, array $storage, $parent = null)
38
    {
39
        \trigger_error(
40
            $this->deprecated(),
41
            \E_USER_DEPRECATED
42
        );
43
44
        parent::__construct($key, $storage, $parent);
45
    }
46
47
}
48