StopCommand::execute()   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 2
1
<?php
2
3
namespace Dock\Cli;
4
5
use Dock\Docker\Compose\Project;
6
use Dock\Project\ProjectManager;
7
use Symfony\Component\Console\Command\Command;
8
use Symfony\Component\Console\Input\InputInterface;
9
use Symfony\Component\Console\Output\OutputInterface;
10
11
class StopCommand extends Command
12
{
13
    /**
14
     * @var ProjectManager
15
     */
16
    private $projectManager;
17
18
    /**
19
     * @var Project
20
     */
21
    private $project;
22
23
    /**
24
     * @param ProjectManager $projectManager
25
     * @param Project        $project
26
     */
27
    public function __construct(ProjectManager $projectManager, Project $project)
28
    {
29
        parent::__construct();
30
31
        $this->projectManager = $projectManager;
32
        $this->project = $project;
33
    }
34
35
    /**
36
     * {@inheritdoc}
37
     */
38
    protected function configure()
39
    {
40
        $this
41
            ->setName('stop')
42
            ->setDescription('Stop the project')
43
        ;
44
    }
45
46
    /**
47
     * {@inheritdoc}
48
     */
49
    protected function execute(InputInterface $input, OutputInterface $output)
50
    {
51
        $this->projectManager->stop($this->project);
52
    }
53
}
54