Completed
Branch 6.0 (d30585)
by yun
06:27
created

Callback   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A exec() 0 6 1
1
<?php
2
// +----------------------------------------------------------------------
3
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
4
// +----------------------------------------------------------------------
5
// | Copyright (c) 2006~2019 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\dispatch;
14
15
use think\route\Dispatch;
16
17
/**
18
 * Callback Dispatcher
19
 */
20
class Callback extends Dispatch
21
{
22 2
    public function exec()
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function exec()
Loading history...
23
    {
24
        // 执行回调方法
25 2
        $vars = array_merge($this->request->param(), $this->param);
0 ignored issues
show
Bug introduced by
It seems like $this->request->param() can also be of type null and object; however, parameter $array1 of array_merge() does only seem to accept array, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

25
        $vars = array_merge(/** @scrutinizer ignore-type */ $this->request->param(), $this->param);
Loading history...
26
27 2
        return $this->app->invoke($this->dispatch, $vars);
28
    }
29
30
}
31