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

DebugCommandLoaderCommand::execute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 10
rs 10
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
}