BucketBootstrapCommand::configure()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

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