Test Setup Failed
Push — master ( 25278d...58aaaa )
by recca
03:37
created

TerminalManager::getConfig()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Recca0120\Terminal;
4
5
use Illuminate\Support\Arr;
6
use Illuminate\Contracts\Foundation\Application as Laravel;
7
8
class TerminalManager
9
{
10
    /**
11
     * $kernel.
12
     *
13
     * @var Recca0120\Terminal\Kernel
14
     */
15
    protected $kernel;
16
17
    /**
18
     * $config.
19
     *
20
     * @var array
21
     */
22
    protected $config;
23
24
    /**
25
     * __construct.
26
     *
27
     * @param \Recca0120\Terminal\Kernel $kernel [description]
28
     * @param array $config
29
     */
30 2
    public function __construct(Kernel $kernel, $config = [])
31
    {
32 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...
33 2
        $this->config = Arr::except(array_merge([
34 2
            'username' => 'LARAVEL',
35 2
            'hostname' => php_uname('n'),
36 2
            'os' => PHP_OS,
37
        ], $config), [
38 2
            'enabled',
39
            'whitelists',
40
            'route',
41
            'commands',
42
        ]);
43 2
    }
44
45
    /**
46
     * getConfig.
47
     *
48
     * @return array
49
     */
50 1
    public function getConfig()
51
    {
52 1
        return $this->config;
53
    }
54
55
    /**
56
     * call.
57
     *
58
     * @param  string $command
59
     * @return int
60
     */
61
    public function call($command)
62
    {
63
        return $this->kernel->call($command);
64
    }
65
66
    /**
67
     * output.
68
     *
69
     * @return string
70
     */
71
    public function output()
72
    {
73
        return $this->kernel->output();
74
    }
75
}
76