Passed
Push — master ( 3eb4db...99d5ff )
by Kirill
03:12
created

Bootloader::defineBindings()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
/**
4
 * Spiral Framework.
5
 *
6
 * @license   MIT
7
 * @author    Anton Titov (Wolfy-J)
8
 */
9
10
declare(strict_types=1);
11
12
namespace Spiral\Boot\Bootloader;
13
14
/**
15
 * Provides ability to initiate set of container bindings using simple string form without closures.
16
 *
17
 * You can make any initializer automatically bootable by defining boot() method with
18
 * automatically resolved arguments.
19
 *
20
 * Attention, you are able to define your own set of shared (short bindings) components in your
21
 * bootloader, DO NOT share your business models this way - use regular DI.
22
 */
23
abstract class Bootloader implements BootloaderInterface, DependedInterface
24
{
25
    protected const BINDINGS     = [];
26
    protected const SINGLETONS   = [];
27
    protected const DEPENDENCIES = [];
28
29
    /**
30
     * {@inheritdoc}
31
     */
32
    public function defineBindings(): array
33
    {
34
        return static::BINDINGS;
35
    }
36
37
    /**
38
     * {@inheritdoc}
39
     */
40
    public function defineSingletons(): array
41
    {
42
        return static::SINGLETONS;
43
    }
44
45
    /**
46
     * {@inheritdoc}
47
     */
48
    public function defineDependencies(): array
49
    {
50
        return static::DEPENDENCIES;
51
    }
52
}
53