Test Failed
Push — master ( a0dd74...a217d0 )
by Julien
03:09
created

CreateFightTable::up()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 20
Code Lines 15

Duplication

Lines 20
Ratio 100 %

Importance

Changes 0
Metric Value
dl 20
loc 20
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 15
nc 1
nop 0
1
<?php
2
3
use Illuminate\Database\Migrations\Migration;
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Support\Facades\Schema;
6
7 View Code Duplication
class CreateFightTable extends Migration
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...
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
8
{
9
    /**
10
     * Run the migrations.
11
     *
12
     * @return void
13
     */
14
    public function up()
15
    {
16
        Schema::create('fight', function(Blueprint $table) {
0 ignored issues
show
Bug introduced by
The method create() does not exist on Illuminate\Support\Facades\Schema. Did you maybe mean createFreshMockInstance()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
17
            $table->increments('id');
18
            $table->integer('round_id')->unsigned()->index();
19
            $table->foreign('round_id')
20
                ->references('id')
21
                ->on('round')
22
                ->onUpdate('cascade')
23
                ->onDelete('cascade');
24
            $table->integer('c1')->nullable()->unsigned()->index();
25
26
            $table->integer('c2')->nullable()->unsigned()->index();
27
28
            $table->tinyInteger("area");
29
            $table->tinyInteger("order");
30
            $table->timestamps();
31
            $table->engine = 'InnoDB';
32
        });
33
    }
34
35
    /**
36
     * Reverse the migrations.
37
     *
38
     * @return void
39
     */
40
    public function down()
41
    {
42
        DB::statement('SET FOREIGN_KEY_CHECKS = 0');
43
        Schema::dropIfExists('fight');
44
        DB::statement('SET FOREIGN_KEY_CHECKS = 1');
45
    }
46
}
47