MigrationsBootstrapper::getBindings()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 4
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AbterPhp\Website\Bootstrappers\Database;
6
7
use AbterPhp\Admin\Bootstrappers\Database\MigrationsBootstrapper as AdminBootstrapper;
8
use AbterPhp\Admin\Bootstrappers\Filesystem\FileFinderBootstrapper;
9
use AbterPhp\Framework\Filesystem\IFileFinder; // @phan-suppress-current-line PhanUnreferencedUseNormal
10
use AbterPhp\Website\Databases\Migrations\Init;
11
use Opulence\Databases\IConnection;
12
use Opulence\Ioc\IContainer;
13
14
class MigrationsBootstrapper extends AdminBootstrapper
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
        /** @var IConnection $connection */
34
        $connection = $container->resolve(IConnection::class);
35
36
        /** @var IFileFinder $fileFinder */
37
        $fileFinder = $container->resolve(FileFinderBootstrapper::MIGRATION_FILE_FINDER);
38
39
        $container->bindInstance(Init::class, new Init($connection, $fileFinder));
40
    }
41
}
42