Issues (20)

src/Rules/HttpRule.php (1 issue)

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
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