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

PrefixRule::prepare()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
ccs 0
cts 3
cp 0
crap 2
rs 10
c 0
b 0
f 0
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