Passed
Push — master ( b13ec5...9d3b12 )
by Patrick
01:29 queued 12s
created

execute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 5
ccs 0
cts 3
cp 0
crap 2
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of forecast.it.fill project.
7
 * (c) Patrick Jaja <[email protected]>
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace ForecastAutomation\PeriodicalActivityDataImport\Shared\Plugin;
13
14
use ForecastAutomation\Kernel\Shared\Plugin\AbstractCommandPlugin;
15
use Symfony\Component\Console\Input\InputInterface;
16
use Symfony\Component\Console\Output\OutputInterface;
17
18
/**
19
 * @method \ForecastAutomation\PeriodicalActivityDataImport\PeriodicalActivityDataImportFacade getFacade()
20
 */
21
class PeriodicalActivityDataImportConsoleCommandPlugin extends AbstractCommandPlugin
22
{
23
    public const COMMAND_NAME = 'forecast:import:periodical:activity';
24
    public const DESCRIPTION = 'This command will import your forecast.it activity, based on activated plugins.';
25
26
    protected function configure(): void
27
    {
28
        $this->setName(self::COMMAND_NAME);
29
        $this->setDescription(self::DESCRIPTION);
30
31
        parent::configure();
32
    }
33
34
    protected function execute(InputInterface $input, OutputInterface $output): int
35
    {
36
        $this->getFacade()->startImportProcess(date('Y-m-d'));
37
38
        return self::SUCCESS;
39
    }
40
}
41