Completed
Push — master ( addaf0...c57d80 )
by Dmitry
03:20
created

Tracker::migrate()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 11
ccs 0
cts 10
cp 0
rs 9.4285
cc 2
eloc 7
nc 2
nop 1
crap 6
1
<?php
2
3
namespace Tarantool\Mapper\Migrations;
4
5
use Tarantool\Mapper\Contracts;
6
7
class Tracker implements Contracts\Migration
8
{
9
    public function migrate(Contracts\Manager $manager)
10
    {
11
        if (!$manager->getSchema()->hasSpace('mapping')) {
12
            $migration = new Bootstrap();
13
            $migration->migrate($manager);
14
        }
15
16
        $migration = $manager->getMeta()->create('migrations', ['name']);
17
        $migration->addIndex(['name']);
18
        $manager->save($manager->get('migrations')->make(['name' => Bootstrap::class]));
0 ignored issues
show
Unused Code introduced by
The call to Repository::make() has too many arguments starting with array('name' => \Taranto...tions\Bootstrap::class).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
19
    }
20
}
21