StopCommand   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 1
cbo 2
dl 0
loc 43
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A configure() 0 7 1
A execute() 0 4 1
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