Passed
Push — 5.2 ( c6dbca...184417 )
by
unknown
02:35
created

Service::commands()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 3
nc 2
nop 1
dl 0
loc 6
rs 10
c 0
b 0
f 0
1
<?php
2
// +----------------------------------------------------------------------
1 ignored issue
show
Coding Style introduced by
You must use "/**" style comments for a file comment
Loading history...
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: yunwuxin <[email protected]>
10
// +----------------------------------------------------------------------
11
declare (strict_types = 1);
12
13
namespace think;
14
15
abstract class Service
1 ignored issue
show
Coding Style introduced by
Missing class doc comment
Loading history...
16
{
17
    protected $app;
18
19
    public function __construct(App $app)
0 ignored issues
show
Coding Style introduced by
Missing function doc comment
Loading history...
20
    {
21
        $this->app = $app;
22
    }
23
24
    /**
0 ignored issues
show
Coding Style introduced by
Parameter $path should have a doc-comment as per coding-style.
Loading history...
25
     * 加载路由
26
     * @param $path
0 ignored issues
show
Coding Style Documentation introduced by
Missing parameter name
Loading history...
27
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
28
    protected function loadRoutesFrom($path)
29
    {
30
        require $path;
0 ignored issues
show
Coding Style introduced by
File is being conditionally included; use "include" instead
Loading history...
31
    }
32
33
    /**
0 ignored issues
show
Coding Style introduced by
Parameter $commands should have a doc-comment as per coding-style.
Loading history...
34
     * 添加指令
35
     * @param $commands
0 ignored issues
show
Coding Style Documentation introduced by
Missing parameter name
Loading history...
36
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
37
    protected function commands($commands)
38
    {
39
        $commands = is_array($commands) ? $commands : func_get_args();
40
41
        Console::init(function (Console $console) use ($commands) {
0 ignored issues
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
42
            $console->addCommands($commands);
43
        });
0 ignored issues
show
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
44
    }
45
}