Completed
Push — master ( 71c78b...6eeaca )
by recca
10:24 queued 05:45
created

TerminalManager   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 68
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 78.95%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
lcom 1
cbo 1
dl 0
loc 68
ccs 15
cts 19
cp 0.7895
rs 10
c 1
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 14 1
A getConfig() 0 4 1
A call() 0 4 1
A output() 0 4 1
1
<?php
2
3
namespace Recca0120\Terminal;
4
5
use Illuminate\Support\Arr;
6
7
class TerminalManager
8
{
9
    /**
10
     * $kernel.
11
     *
12
     * @var Recca0120\Terminal\Kernel
13
     */
14
    protected $kernel;
15
16
    /**
17
     * $config.
18
     *
19
     * @var array
20
     */
21
    protected $config;
22
23
    /**
24
     * __construct.
25
     *
26
     * @param \Recca0120\Terminal\Kernel $kernel
27
     * @param array $config
28
     */
29 2
    public function __construct(Kernel $kernel, $config = [])
30
    {
31 2
        $this->kernel = $kernel;
1 ignored issue
show
Documentation Bug introduced by
It seems like $kernel of type object<Recca0120\Terminal\Kernel> is incompatible with the declared type object<Recca0120\Termina...ca0120\Terminal\Kernel> of property $kernel.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
32 2
        $this->config = Arr::except(array_merge([
33 2
            'username' => 'LARAVEL',
34 2
            'hostname' => php_uname('n'),
35 2
            'os' => PHP_OS,
36 2
        ], $config), [
37 2
            'enabled',
38 2
            'whitelists',
39 2
            'route',
40 2
            'commands',
41 2
        ]);
42 2
    }
43
44
    /**
45
     * getConfig.
46
     *
47
     * @return array
48
     */
49 1
    public function getConfig()
50
    {
51 1
        return $this->config;
52
    }
53
54
    /**
55
     * call.
56
     *
57
     * @param  string $command
58
     * @return int
59
     */
60
    public function call($command)
61
    {
62
        return $this->kernel->call($command);
63
    }
64
65
    /**
66
     * output.
67
     *
68
     * @return string
69
     */
70
    public function output()
71
    {
72
        return $this->kernel->output();
73
    }
74
}
75