Completed
Pull Request — master (#3)
by Бабичев
03:59
created

PrefixRule   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 22
ccs 0
cts 3
cp 0
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A prepare() 0 4 1
1
<?php
2
3
namespace Bavix\Router\Rules;
4
5
use Bavix\Router\RegExp;
6
use Bavix\Router\Resolable;
7
use Bavix\Router\Rule;
8
9
class PrefixRule extends Rule
10
{
11
12
    use Resolable;
13
14
    /**
15
     * @var string
16
     */
17
    protected $protocol;
18
19
    /**
20
     * @var string
21
     */
22
    protected $host;
23
24
    /**
25
     * @inheritdoc
26
     */
27
    protected function prepare(): void
28
    {
29
        $this->protocol = new RegExp('\w+');
30
        $this->host = new RegExp('[^\/]+');
31
    }
32
33
}
34