Passed
Push — master ( ca4974...4643e0 )
by Peter
02:13
created

MigrationsBootstrapper::getBindings()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AbterPhp\Files\Bootstrappers\Database;
6
7
use AbterPhp\Admin\Bootstrappers\Database\MigrationsBootstrapper as AdminBootstrapper;
8
use AbterPhp\Website\Databases\Migrations\Init;
9
use Opulence\Databases\IConnection;
10
use Opulence\Ioc\IContainer;
11
12
class MigrationsBootstrapper extends AdminBootstrapper
13
{
14
    const MODULE_KEY = 'AbterPhp\\Files';
15
16
    /**
17
     * @return array
18
     */
19
    public function getBindings(): array
20
    {
21
        return [
22
            Init::class,
23
        ];
24
    }
25
26
    /**
27
     * @param IContainer $container
28
     *
29
     * @throws \Opulence\Ioc\IocException
30
     */
31
    public function registerBindings(IContainer $container)
32
    {
33
        $migrationsPath = $this->getMigrationPath();
34
        $driver         = $this->getDriver();
35
36
        /** @var IConnection $connection */
37
        $connection = $container->resolve(IConnection::class);
38
39
        $migration = new Init($connection, $migrationsPath, $driver);
40
41
        $container->bindInstance(Init::class, $migration);
42
    }
43
}
44