CreateSessionsTable::down()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
nc 1
nop 0
dl 0
loc 3
c 1
b 0
f 0
cc 1
rs 10
1
<?php
2
3
use Illuminate\Database\Migrations\Migration;
4
use Illuminate\Database\Schema\Blueprint;
5
6
class CreateSessionsTable extends Migration {
7
8
	/**
9
	 * Run the migrations.
10
	 *
11
	 * @return void
12
	 */
13
	public function up()
14
	{
15
		Schema::create('sessions', function(Blueprint $table)
16
		{
17
			$table->string('id', 191)->unique();
18
			$table->integer('admin_id')->unsigned()->nullable();
19
			$table->string('ip_address', 45)->nullable();
20
			$table->text('user_agent', 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

20
			$table->/** @scrutinizer ignore-call */ 
21
           text('user_agent', 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...
21
			$table->text('payload', 65535);
22
			$table->integer('last_activity');
23
		});
24
	}
25
26
27
	/**
28
	 * Reverse the migrations.
29
	 *
30
	 * @return void
31
	 */
32
	public function down()
33
	{
34
		Schema::drop('sessions');
35
	}
36
37
}
38