CreateMatchTable   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 4
Bugs 0 Features 1
Metric Value
wmc 1
c 4
b 0
f 1
lcom 0
cbo 4
dl 0
loc 26
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 18 1
1
<?php
2
3
use Illuminate\Database\Capsule\Manager as Capsule;
4
use \Illuminate\Database\Schema\Blueprint as Blueprint;
5
6
class CreateMatchTable
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...
7
{
8
    /**
9
     * Run the migrations.
10
     *
11
     * @return void
12
     */
13
    public function run()
14
    {
15
        Capsule::schema()->dropIfExists('matches');
16
        Capsule::schema()->create('matches', function (Blueprint $table) {
17
            $table->increments('id');
18
            $table->integer('league_round_id')->nullable();
19
            $table->integer('home_team_id');
20
            $table->integer('goal_home')->default(0);
21
            $table->integer('away_team_id');
22
            $table->integer('goal_away')->default(0);
23
            $table->boolean('is_draw')->default(false);
24
            $table->integer('winner_id')->default(null);
25
            $table->integer('loser_id')->default(null);
26
            $table->boolean('simulated')->default(false);
27
            $table->date('match_date')->default(\Carbon\Carbon::now());
28
            $table->timestamps();
29
        });
30
    }
31
}
32