ChangeTeamNameLength   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 83.33%

Importance

Changes 0
Metric Value
wmc 6
lcom 0
cbo 3
dl 0
loc 31
ccs 10
cts 12
cp 0.8333
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
B up() 0 18 5
A down() 0 3 1
1
<?php
2
3
use BZIon\Migration\AbstractMigration;
4
5
class ChangeTeamNameLength extends AbstractMigration
6
{
7
    /**
8
     * Migrate Up.
9
     */
10 1
    public function up()
11
    {
12 1
        $table = $this->table('teams');
13
14 1
        foreach ($table->getColumns() as $column) {
15 1
            if ($column->getName() === 'name' || $column->getName() === 'alias') {
16 1
                $column->setLimit(42);
17
18 1
                if ($column->getName() === 'name') {
19 1
                    $column->setComment("The team's name");
20
                } else {
21 1
                    $column->setComment("The team's URL slug for viewing the team's profile");
22
                }
23
24 1
                $table->changeColumn($column->getName(), $column);
25
            }
26
        }
27 1
    }
28
29
    /**
30
     * Migrate Down.
31
     */
32
    public function down()
33
    {
34
    }
35
}
36