Passed
Push — master ( 304bdf...88940e )
by Paweł
02:06
created

DebugCommandLoaderCommand   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 16
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A execute() 0 10 1
1
<?php
2
3
namespace pjpawel\LightApi\Command\Internal;
4
5
use pjpawel\LightApi\Command\CommandsLoader;
6
use pjpawel\LightApi\Command\Input\InputInterface;
7
use pjpawel\LightApi\Command\Output\OutputInterface;
8
use ReflectionClass;
9
10
class DebugCommandLoaderCommand extends KernelAwareCommand
11
{
12
13
    /**
14
     * @inheritDoc
15
     */
16
    public function execute(InputInterface $input, OutputInterface $output): int
17
    {
18
        $reflectionKernel = new ReflectionClass($this->kernel);
19
        $commandLoaderReflection = $reflectionKernel->getProperty('commandLoader');
20
        /** @var CommandsLoader $commandLoader */
21
        $commandLoader = $commandLoaderReflection->getValue($this->kernel);
22
23
        $output->writeln(array_keys($commandLoader->command));
24
25
        return self::SUCCESS;
26
    }
27
}