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

Callback::exec()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

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