Passed
Pull Request — master (#28)
by Patrick
03:01
created

ConsoleDependencyProvider   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 10
c 0
b 0
f 0
dl 0
loc 29
ccs 0
cts 13
cp 0
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A createForecastImportActivityConsoleCommandPlugin() 0 3 1
A provideDependencies() 0 8 1
A creatPeriodicalActivityConsoleCommandPlugin() 0 3 1
A createQueueClientConsumerConsoleCommandPlugin() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of forecast.it.fill project.
7
 * (c) Patrick Jaja <[email protected]>
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace ForecastAutomation\Console;
13
14
use ForecastAutomation\ForecastDataImport\Shared\Plugin\ForecastImportActivityConsoleCommandPlugin;
15
use ForecastAutomation\Kernel\AbstractDependencyProvider;
16
use ForecastAutomation\Kernel\Locator;
17
use ForecastAutomation\PeriodicalActivityDataImport\Shared\Plugin\PeriodicalActivityDataImportConsoleCommandPlugin;
18
use ForecastAutomation\QueueClient\Shared\Plugin\QueueClientConsumerConsoleCommandPlugin;
19
20
class ConsoleDependencyProvider extends AbstractDependencyProvider
21
{
22
    public const CONSOLE_PLUGINS = 'CONSOLE_PLUGINS';
23
24
    public function provideDependencies(Locator $locator): void
25
    {
26
        $this->set(
27
            self::CONSOLE_PLUGINS,
28
            [
29
                $this->createForecastImportActivityConsoleCommandPlugin(),
30
                $this->creatPeriodicalActivityConsoleCommandPlugin(),
31
                $this->createQueueClientConsumerConsoleCommandPlugin(),
32
            ]
33
        );
34
    }
35
36
    protected function createForecastImportActivityConsoleCommandPlugin(): ForecastImportActivityConsoleCommandPlugin
37
    {
38
        return new ForecastImportActivityConsoleCommandPlugin();
39
    }
40
41
    protected function createQueueClientConsumerConsoleCommandPlugin(): QueueClientConsumerConsoleCommandPlugin
42
    {
43
        return new QueueClientConsumerConsoleCommandPlugin();
44
    }
45
46
    protected function creatPeriodicalActivityConsoleCommandPlugin(): PeriodicalActivityDataImportConsoleCommandPlugin
47
    {
48
        return new PeriodicalActivityDataImportConsoleCommandPlugin();
49
    }
50
}
51