Test Setup Failed
Pull Request — master (#42)
by Matthew
02:49
created

CreateDraftStats   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 33
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B change() 0 30 1
1
<?php
2
3
use Phinx\Migration\AbstractMigration;
4
5
class CreateDraftStats extends AbstractMigration
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
6
{
7
    public function change()
8
    {
9
        $draft_stats = $this->table('draft_stats', ['id' => 'draft_stat_id']);
10
        
11
        $draft_stats->addColumn('draft_id', 'integer', ['limit' => 11])
12
                ->addColumn('drafting_time_seconds', 'integer', ['limit' => 11])
13
                ->addColumn('longest_avg_pick_manager_name', 'text')
14
                ->addColumn('longest_avg_pick_seconds', 'integer', ['limit' => 11])
15
                ->addColumn('shortest_avg_pick_manager_name', 'text')
16
                ->addColumn('shortest_avg_pick_seconds', 'integer', ['limit' => 11])
17
                ->addColumn('longest_single_pick_manager_name', 'text')
18
                ->addColumn('longest_single_pick_seconds', 'integer', ['limit' => 11])
19
                ->addColumn('shortest_single_pick_manager_name', 'text')
20
                ->addColumn('shortest_single_pick_seconds', 'integer', ['limit' => 11])
21
                ->addColumn('average_pick_seconds', 'integer', ['limit' => 11])
22
                ->addColumn('longest_round', 'integer', ['limit' => 11])
23
                ->addColumn('longest_round_seconds', 'integer', ['limit' => 11])
24
                ->addColumn('shortest_round', 'integer', ['limit' => 11])
25
                ->addColumn('shortest_round_seconds', 'integer', ['limit' => 11])
26
                ->addColumn('average_round_seconds', 'integer', ['limit' => 11])
27
                ->addColumn('most_drafted_team', 'text')
28
                ->addColumn('most_drafted_team_count', 'integer', ['limit' => 11])
29
                ->addColumn('least_drafted_team', 'text')
30
                ->addColumn('least_drafted_team_count', 'integer', ['limit' => 11])
31
                ->addColumn('most_drafted_position', 'text')
32
                ->addColumn('most_drafted_position_count', 'integer', ['limit' => 11])
33
                ->addColumn('least_drafted_position', 'text')
34
                ->addColumn('least_drafted_position_count', 'integer', ['limit' => 11])
35
                ->create();
36
    }
37
}
38