CronTestCommand::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 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 5
rs 9.4285
cc 1
eloc 3
nc 1
nop 2
1
<?php
2
3
namespace Alpixel\Bundle\CronBundle\Tests\Fixtures;
4
5
use Alpixel\Bundle\CronBundle\Annotation\CronJob;
6
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
7
use Symfony\Component\Console\Input\InputInterface;
8
use Symfony\Component\Console\Output\OutputInterface;
9
10
/**
11
 * @CronJob("PT1S")
12
 */
13
class CronTestCommand extends ContainerAwareCommand
14
{
15
    protected function configure()
16
    {
17
        $this->setName('my_cron_test')->setDescription('Test my new cron job');
18
    }
19
20
    protected function execute(InputInterface $input, OutputInterface $output)
21
    {
22
        file_put_contents(__DIR__.'/app/cache/cron_result.log', 'ok');
23
        $output->writeln('This is a test');
24
    }
25
}
26