Passed
Push — master ( e666cf...efe7b1 )
by Iman
07:49
created

CreateCmsMenusTable   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 35
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 16 1
A down() 0 3 1
1
<?php
2
3
use Illuminate\Database\Migrations\Migration;
4
use Illuminate\Database\Schema\Blueprint;
5
6
class CreateCmsMenusTable extends Migration {
7
8
	/**
9
	 * Run the migrations.
10
	 *
11
	 * @return void
12
	 */
13
	public function up()
14
	{
15
		Schema::create('cms_menus', function(Blueprint $table)
16
		{
17
			$table->increments('id');
18
			$table->string('name', 30)->nullable();
19
			$table->string('type', 30)->default('url');
20
			$table->string('path', 50)->nullable();
21
			$table->string('color', 30)->nullable();
22
			$table->string('icon', 30)->nullable();
23
			$table->integer('parent_id')->nullable();
24
			$table->boolean('is_active')->default(1);
25
			$table->boolean('is_dashboard')->default(0);
26
			$table->integer('sorting')->nullable();
27
			$table->timestamps();
28
			$table->text('cms_privileges', 65535)->nullable();
0 ignored issues
show
Unused Code introduced by
The call to Illuminate\Database\Schema\Blueprint::text() has too many arguments starting with 65535. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

28
			$table->/** @scrutinizer ignore-call */ 
29
           text('cms_privileges', 65535)->nullable();

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
29
		});
30
	}
31
32
33
	/**
34
	 * Reverse the migrations.
35
	 *
36
	 * @return void
37
	 */
38
	public function down()
39
	{
40
		Schema::drop('cms_menus');
41
	}
42
43
}
44