WaitCommand::execute()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 2
dl 0
loc 7
rs 10
c 0
b 0
f 0
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