ImportTeam::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
4
namespace App\GameApi\Communication\Command;
5
6
7
use App\GameApi\Business\ApiFootballData\Import\TeamInterface;
8
use Symfony\Component\Console\Command\Command;
9
use Symfony\Component\Console\Input\InputInterface;
10
use Symfony\Component\Console\Output\OutputInterface;
11
12
class ImportTeam extends Command
13
{
14
    /**
15
     * @var TeamInterface
16
     */
17
    private $team;
18
19
    const COMMAND_NAME = 'api:import:team';
20
    const DESCRIPTION = 'Import teams from api';
21
22
    /**
23
     * @param TeamInterface $team
24
     */
25
    public function __construct(TeamInterface $team)
26
    {
27
        $this->team = $team;
28
        parent::__construct();
29
    }
30
31
    /**
32
     * @return void
33
     */
34
    protected function configure()
35
    {
36
        $this->setName(static::COMMAND_NAME)
37
            ->setDescription(static::DESCRIPTION);
38
    }
39
40
    protected function execute(InputInterface $input, OutputInterface $output)
41
    {
42
        $this->team->import();
43
    }
44
}