DumpJSCommand   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 4
dl 0
loc 22
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 7 1
A execute() 0 5 1
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 DumpJSCommand extends AbstractPimpleCommand
11
{
12
    protected function configure()
13
    {
14
        $this
15
            ->setName('jsrouting:dump')
16
            ->setDescription('dumps the full 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->getJSwithRoutes());
30
    }
31
}