Passed
Push — 8.0 ( f1ecf8...279f5c )
by liu
13:10
created

Domain::bind()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
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 1
dl 0
loc 5
ccs 0
cts 3
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
// +----------------------------------------------------------------------
3
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
4
// +----------------------------------------------------------------------
5
// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
6
// +----------------------------------------------------------------------
7
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
8
// +----------------------------------------------------------------------
9
// | Author: liu21st <[email protected]>
10
// +----------------------------------------------------------------------
11
declare (strict_types = 1);
12
13
namespace think\route;
14
15
use think\Route;
16
17
/**
18
 * 域名路由
19
 */
20
class Domain extends RuleGroup
21
{
22
    /**
23
     * 架构函数
24
     * @access public
25
     * @param  Route       $router   路由对象
26
     * @param  string      $name     路由域名
27
     * @param  mixed       $rule     域名路由
28
     * @param  bool        $lazy   延迟解析
29
     */
30 27
    public function __construct(Route $router, ?string $name = null, $rule = null, bool $lazy = false)
31
    {
32 27
        $this->router = $router;
33 27
        $this->domain = $name;
34 27
        $this->rule   = $rule;
35
36 27
        if (!$lazy && !is_null($rule)) {
37 3
            $this->parseGroupRule($rule);
38
        }
39
    }
40
41
}
42