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

DebugContainerCommand::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\Input\InputInterface;
6
use pjpawel\LightApi\Command\Output\OutputInterface;
7
use pjpawel\LightApi\Container\ContainerLoader;
8
use ReflectionClass;
9
10
class DebugContainerCommand 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
        $containerLoaderReflection = $reflectionKernel->getProperty('containerLoader');
20
        /** @var ContainerLoader $containerLoader */
21
        $containerLoader = $containerLoaderReflection->getValue($this->kernel);
22
23
        $output->writeln(array_keys($containerLoader->definitions));
24
25
        return self::SUCCESS;
26
    }
27
}