WaitCommand   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 19
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 8 1
A execute() 0 7 2
1
<?php
2
3
namespace test\Vivait\TenantBundle\Command;
4
5
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
6
use Symfony\Component\Console\Command\Command;
7
use Symfony\Component\Console\Input\InputArgument;
8
use Symfony\Component\Console\Input\InputInterface;
9
use Symfony\Component\Console\Input\InputOption;
10
use Symfony\Component\Console\Output\OutputInterface;
11
use Vivait\TenantBundle\Kernel\TenantKernel;
12
use Vivait\TenantBundle\Model\Tenant;
13
use Vivait\TenantBundle\Registry\TenantRegistry;
14
15
class WaitCommand extends ContainerAwareCommand
16
{
17
    protected function configure()
18
    {
19
        $this
20
            ->setName('vivait:tenants:wait')
21
            ->setDescription('Waits a specified number of seconds - use only for debugging')
22
            ->addArgument('time', InputArgument::OPTIONAL, 'Number of seconds to wait', 2)
23
        ;
24
    }
25
26
    protected function execute(InputInterface $input, OutputInterface $output)
27
    {
28
        for ($i = 1; $i <= $input->getArgument('time'); $i++) {
29
            echo $i;
30
            sleep(1);
31
        }
32
    }
33
}
34