Passed
Push — refactor/setup-gacela-2 ( 32146e )
by Chema
05:11
created

Properties::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 7
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Gacela\Framework\Bootstrap\Setup;
6
7
use Closure;
8
use Gacela\Framework\Config\GacelaConfigBuilder\AppConfigBuilder;
9
use Gacela\Framework\Config\GacelaConfigBuilder\BindingsBuilder;
10
use Gacela\Framework\Config\GacelaConfigBuilder\SuffixTypesBuilder;
11
use Gacela\Framework\Event\Dispatcher\EventDispatcherInterface;
12
13
/**
14
 * Value object that holds all SetupGacela properties.
15
 */
16
final class Properties
17
{
18
    /** @var callable(AppConfigBuilder):void */
19
    public $appConfigFn;
20
21
    /** @var callable(BindingsBuilder,array<string,mixed>):void */
22
    public $bindingsFn;
23
24
    /** @var callable(SuffixTypesBuilder):void */
25
    public $suffixTypesFn;
26
27
    /** @var ?array<string,class-string|object|callable> */
28
    public ?array $externalServices = null;
29
30
    public ?AppConfigBuilder $appConfigBuilder = null;
31
32
    public ?SuffixTypesBuilder $suffixTypesBuilder = null;
33
34
    public ?BindingsBuilder $bindingsBuilder = null;
35
36
    public ?bool $shouldResetInMemoryCache = null;
37
38
    public ?bool $fileCacheEnabled = null;
39
40
    public ?string $fileCacheDirectory = null;
41
42
    /** @var ?list<string> */
43
    public ?array $projectNamespaces = null;
44
45
    /** @var ?array<string,mixed> */
46
    public ?array $configKeyValues = null;
47
48
    public ?bool $areEventListenersEnabled = null;
49
50
    /** @var ?list<callable> */
51
    public ?array $genericListeners = null;
52
53
    /** @var ?array<class-string,list<callable>> */
54
    public ?array $specificListeners = null;
55
56
    public ?EventDispatcherInterface $eventDispatcher = null;
57
58
    /** @var ?array<string,list<Closure>> */
59
    public ?array $servicesToExtend = null;
60
61
    /** @var ?list<class-string> */
62
    public ?array $gacelaConfigsToExtend = null;
63
64
    /** @var ?list<class-string|callable> */
65
    public ?array $plugins = null;
66
67
    public function __construct()
68
    {
69
        $emptyFn = static function (): void {};
70
71
        $this->appConfigFn = $emptyFn;
72
        $this->bindingsFn = $emptyFn;
73
        $this->suffixTypesFn = $emptyFn;
74
    }
75
}
76