Completed
Push — master ( 1d22e2...c9d80a )
by Ma
07:57
created

ConfigProvider   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
dl 0
loc 44
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getConsoleConfig() 0 6 1
A __invoke() 0 5 1
A getDependencies() 0 6 1
1
<?php
2
3
/**
4
 * Aist Console (http://mateuszsitek.com/projects/console)
5
 *
6
 * @copyright Copyright (c) 2017 DIGITAL WOLVES LTD (http://digitalwolves.ltd) All rights reserved.
7
 * @license   http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
8
 */
9
10
namespace Aist\Console;
11
12
use Aist\Console\Helper\HelperSetFactory;
13
use Aist\Console\Helper\Logger\LoggerHelper;
14
use Aist\Console\Helper\Logger\LoggerHelperFactory;
15
use Symfony\Component\Console\Helper\HelperSet;
16
17
class ConfigProvider
18
{
19
    /**
20
     * Returns the configuration array
21
     *
22
     * To add a bit of a structure, each section is defined in a separate
23
     * method which returns an array with its configuration.
24
     *
25
     * @return array
26
     */
27
    public function __invoke()
28
    {
29
        return [
30
            'dependencies' => $this->getDependencies(),
31
            'console' => $this->getConsoleConfig(),
32
        ];
33
    }
34
35
    /**
36
     * Returns console configuration
37
     *
38
     * @return array
39
     */
40
    public function getConsoleConfig()
41
    {
42
        return [
43
            'commands' => [],
44
            'helpers' => [
45
                'logger' => LoggerHelper::class,
46
            ],
47
        ];
48
    }
49
50
    /**
51
     * Returns the container dependencies
52
     *
53
     * @return array
54
     */
55
    public function getDependencies()
56
    {
57
        return [
58
            'factories'  => [
59
                HelperSet::class => HelperSetFactory::class,
60
                LoggerHelper::class => LoggerHelperFactory::class,
61
            ],
62
        ];
63
    }
64
}
65