Passed
Push — master ( 28f242...472b4c )
by Gabriel
04:44
created

MigrationsServiceProvider::provides()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace ByTIC\Migrations;
4
5
use ByTIC\Migrations\Console\CreateCommand;
6
use ByTIC\Migrations\Console\MigrateCommand;
7
use Nip\Container\ServiceProviders\Providers\AbstractSignatureServiceProvider;
8
9
/**
10
 * Class MigrationsServiceProvider
11
 * @package ByTIC\Scheduler
12
 */
13
class MigrationsServiceProvider extends AbstractSignatureServiceProvider
14
{
15
    /**
16
     * @inheritdoc
17
     */
18
    public function register()
19
    {
20
        $this->registerMigrator();
21
    }
22
23
    protected function registerMigrator()
24
    {
25
        $this->getContainer()->share('migrations.migrator', function () {
26
            $migrator = $this->getContainer()->get(Migrator::class);
27
            return $migrator;
28
        });
29
    }
30
31
    protected function registerCommands()
32
    {
33
        $this->commands(
34
            MigrateCommand::class,
35
            CreateCommand::class
36
        );
37
    }
38
39
    /**
40
     * @inheritdoc
41
     */
42
    public function provides()
43
    {
44
        return ['migrations.migrator'];
45
    }
46
}
47