Completed
Push — master ( c5110b...a167e6 )
by Valentyn
13:46
created

RunReleaseDateQueue   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 2
cbo 3
dl 0
loc 26
ccs 0
cts 14
cp 0
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A configure() 0 7 1
A execute() 0 6 1
1
<?php
2
3
namespace App\Movies\Command;
4
5
use App\Movies\Service\ReleaseDateService;
6
use Symfony\Component\Console\Command\Command;
7
use Symfony\Component\Console\Input\InputInterface;
8
use Symfony\Component\Console\Output\OutputInterface;
9
10
class RunReleaseDateQueue extends Command
11
{
12
    private $releaseDateService;
13
14
    public function __construct(ReleaseDateService $releaseDateService, ?string $name = null)
15
    {
16
        parent::__construct($name);
17
18
        $this->releaseDateService = $releaseDateService;
19
    }
20
21
    protected function configure()
22
    {
23
        $this
24
            ->setName('app:run-release-date-queue')
25
            ->setDescription('Check new release dates')
26
            ->setHelp('This command will search for new release dates on resources like imdb and tmdb');
27
    }
28
29
    protected function execute(InputInterface $input, OutputInterface $output)
30
    {
31
        $output->writeln(sprintf('Queue started at %s', \date('d-m-Y h:i:s')));
32
        $this->releaseDateService->runCheck();
33
        $output->writeln(sprintf('Queue ended at %s', \date('d-m-Y h:i:s')));
34
    }
35
}
36