CreateLeaguesTable   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 86.36%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 46
ccs 19
cts 22
cp 0.8636
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
B up() 0 27 1
A down() 0 4 1
1
<?php
2
3
use Illuminate\Database\Schema\Blueprint;
4
use Illuminate\Database\Migrations\Migration;
5
6
class CreateLeaguesTable 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...
7
8
	/**
9
	 * Run the migrations.
10
	 *
11
	 * @return void
12
	 */
13
	public function up()
14
	{
15 9
		Schema::create('leagues', function(Blueprint $table)
16
		{
17 9
			$table->increments('id');
18 9
			$table->string('name');
19 9
			$table->string('slug');
20 9
			$table->text('description');
21 9
			$table->text('url')->nullable();
22
23 9
			$table->string('mode', 16)->default(Config::get('draft.league_defaults.mode'));
24 9
			$table->integer('money')->default(Config::get("draft.league_defaults.money"));
25 9
			$table->string('units', 16)->default(Config::get('draft.league_defaults.units'));
26 9
			$table->integer('extra_weeks')->default(Config::get('draft.league_defaults.extra_weeks'));
27
28 9
			$table->date('start_date');
29 9
			$table->date('end_date');
30 9
			$table->boolean('active')->default(false)->nullable();
31
32 9
			$table->boolean('private')->default(false)->nullable();
33 9
			$table->boolean('featured')->default(false)->nullable();
34
35 9
			$table->timestamps();
36
37 9
			$table->unique('slug');
38 9
		});
39 9
	}
40
41
	/**
42
	 * Reverse the migrations.
43
	 *
44
	 * @return void
45
	 */
46
	public function down()
47
	{
48
		Schema::drop('leagues');
49
	}
50
51
}
52