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

BucketBootstrapCommand::execute()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 3
nc 2
nop 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