Passed
Push — master ( c5db43...5f6140 )
by Dmitrij
02:41
created

GetCommands::__invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 0
1
<?php
2
3
namespace HotRodCli\Api;
4
5
use HotRodCli\AppContainer;
6
7
class GetCommands
8
{
9
    protected $container;
10
11
    public function __construct(AppContainer $appContainer)
12
    {
13
        $this->container = $appContainer;
14
    }
15
16
    public function __invoke()
17
    {
18
        return json_encode(array_keys($this->container->resolve('commands')));
0 ignored issues
show
Bug introduced by
It seems like $this->container->resolve('commands') can also be of type object and commands; however, parameter $input of array_keys() 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

18
        return json_encode(array_keys(/** @scrutinizer ignore-type */ $this->container->resolve('commands')));
Loading history...
19
    }
20
}
21