Completed
Push — master ( fbc42e...4f026e )
by Jonas
21:13
created

BucketBootstrapCommand   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A configure() 0 5 1
A execute() 0 6 2
1
<?php
2
declare(strict_types=1);
3
4
/*
5
 * This file is part of SteamScore.
6
 *
7
 * (c) SteamScore <[email protected]>
8
 *
9
 * This Source Code Form is subject to the terms of the Mozilla Public
10
 * License, v. 2.0. If a copy of the MPL was not distributed with this
11
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
12
 */
13
14
namespace SteamScore\Api\Console\Commands;
15
16
use SteamScore\Api\Domain\Interfaces\BucketManagerInterface;
17
use Symfony\Component\Console\Command\Command;
18
use Symfony\Component\Console\Input\InputInterface;
19
use Symfony\Component\Console\Output\OutputInterface;
20
21
final class BucketBootstrapCommand extends Command
22
{
23
    /**
24
     * @var BucketManagerInterface
25
     */
26
    private $manager;
27
28
    /**
29
     * Constructor.
30
     *
31
     * @param BucketManagerInterface $manager
32
     */
33
    public function __construct(BucketManagerInterface $manager)
34
    {
35
        parent::__construct();
36
37
        $this->manager = $manager;
38
    }
39
40
    /**
41
     * {@inheritdoc}
42
     */
43
    protected function configure()
44
    {
45
        $this->setName('bucket:bootstrap');
46
        $this->setDescription('Creates new users.');
47
    }
48
49
    /**
50
     * {@inheritdoc}
51
     */
52
    protected function execute(InputInterface $input, OutputInterface $output)
53
    {
54
        foreach ($this->manager->getAll() as $bucket) {
55
            $bucket->bootstrap();
56
        }
57
    }
58
}
59