DumpRouterCommand::execute()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 5
rs 9.4285
cc 1
eloc 3
nc 1
nop 2
1
<?php
2
3
namespace rootLogin\JSRoutingProvider\Command;
4
5
use rootLogin\JSRoutingProvider\JSRoutingProvider;
6
use Saxulum\Console\Command\AbstractPimpleCommand;
7
use Symfony\Component\Console\Input\InputInterface;
8
use Symfony\Component\Console\Output\OutputInterface;
9
10
class DumpRouterCommand extends AbstractPimpleCommand
11
{
12
    protected function configure()
13
    {
14
        $this
15
            ->setName('jsrouting:dump:router')
16
            ->setDescription('dumps the router.js javascript')
17
        ;
18
    }
19
20
    /**
21
     * @param  InputInterface    $input
22
     * @param  OutputInterface   $output
23
     * @return int|null|void
24
     * @throws \RuntimeException
25
     */
26
    protected function execute(InputInterface $input, OutputInterface $output)
27
    {
28
        $jsrp = new JSRoutingProvider($this->container);
0 ignored issues
show
Compatibility introduced by
$this->container of type object<Pimple> is not a sub-type of object<Silex\Application>. It seems like you assume a child class of the class Pimple to be always present.

This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.

Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.

Loading history...
29
        $output->writeln($jsrp->getJavaScript());
30
    }
31
}