Passed
Push — bugfix/support-windows ( 0e99e7...b5ecf8 )
by Jesús
06:33 queued 02:55
created

AbstractSetupGacela   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 34
ccs 8
cts 8
cp 1
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A externalServices() 0 3 1
A buildSuffixTypes() 0 3 1
A buildBindings() 0 3 1
A buildAppConfig() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Gacela\Framework\Bootstrap;
6
7
use Gacela\Framework\Config\GacelaConfigBuilder\AppConfigBuilder;
8
use Gacela\Framework\Config\GacelaConfigBuilder\BindingsBuilder;
9
use Gacela\Framework\Config\GacelaConfigBuilder\SuffixTypesBuilder;
10
11
abstract class AbstractSetupGacela implements SetupGacelaInterface
12
{
13
    /**
14
     * Define different config sources.
15
     */
16 64
    public function buildAppConfig(AppConfigBuilder $builder): AppConfigBuilder
17
    {
18 64
        return $builder;
19
    }
20
21
    /**
22
     * Define the mapping between interfaces and concretions, so Gacela services will auto-resolve them automatically.
23
     *
24
     * @param array<string, class-string|object|callable> $externalServices
25
     */
26 64
    public function buildBindings(BindingsBuilder $builder, array $externalServices): BindingsBuilder
27
    {
28 64
        return $builder;
29
    }
30
31
    /**
32
     * Allow overriding gacela resolvable types.
33
     */
34 64
    public function buildSuffixTypes(SuffixTypesBuilder $builder): SuffixTypesBuilder
35
    {
36 64
        return $builder;
37
    }
38
39
    /**
40
     * @return array<string, class-string|object|callable>
41
     */
42 27
    public function externalServices(): array
43
    {
44 27
        return [];
45
    }
46
}
47