Passed
Push — master ( 283a68...920509 )
by Marcel
03:07 queued 11s
created

Load   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 13
c 1
b 0
f 0
dl 0
loc 29
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A configure() 0 9 1
A execute() 0 4 1
1
<?php
2
/**
3
 * Data Analytics
4
 *
5
 * This file is licensed under the Affero General Public License version 3 or
6
 * later. See the LICENSE.md file.
7
 *
8
 * @author Marcel Scherello <[email protected]>
9
 * @copyright 2020 Marcel Scherello
10
 */
11
12
namespace OCA\Analytics\Command;
13
14
use OCA\Analytics\Controller\DataloadController;
15
use Symfony\Component\Console\Command\Command;
16
use Symfony\Component\Console\Input\InputArgument;
17
use Symfony\Component\Console\Input\InputInterface;
18
use Symfony\Component\Console\Output\OutputInterface;
19
20
class Load extends Command
21
{
22
23
    private $DataloadController;
24
25
    public function __construct(
26
        DataloadController $DataloadController
27
    )
28
    {
29
        $this->DataloadController = $DataloadController;
30
        parent::__construct();
31
    }
32
33
    protected function configure()
34
    {
35
        $this
36
            ->setName('analytics:load')
37
            ->setDescription('execute a dataload')
38
            ->addArgument(
39
                'dataloadId',
40
                InputArgument::REQUIRED,
41
                'dataload to be executed'
42
            );
43
    }
44
45
    protected function execute(InputInterface $input, OutputInterface $output)
46
    {
47
        $dataloadId = $input->getArgument('dataloadId');
48
        $this->DataloadController->execute($dataloadId);
0 ignored issues
show
Bug introduced by
$dataloadId of type null|string|string[] is incompatible with the type integer expected by parameter $dataloadId of OCA\Analytics\Controller...adController::execute(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

48
        $this->DataloadController->execute(/** @scrutinizer ignore-type */ $dataloadId);
Loading history...
49
    }
50
}