Completed
Push — master ( b985db...bee0c3 )
by Christian
05:14
created

AddLanguageToUsersTable::up()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 4
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
use Illuminate\Support\Facades\Schema;
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Database\Migrations\Migration;
6
7
class AddLanguageToUsersTable extends Migration
8
{
9
    /**
10
     * Run the migrations.
11
     *
12
     * @return void
13
     */
14 51
    public function up()
15
    {
16
        Schema::table('users', function (Blueprint $table) {
17 51
            $table->string('language')->after('name')->default(app()->getLocale());
0 ignored issues
show
introduced by
The method getLocale() does not exist on Illuminate\Container\Container. Are you sure you never get this type here, but always one of the subclasses? ( Ignorable by Annotation )

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

17
            $table->string('language')->after('name')->default(app()->/** @scrutinizer ignore-call */ getLocale());
Loading history...
18 51
        });
19 51
    }
20
21
    /**
22
     * Reverse the migrations.
23
     *
24
     * @return void
25
     */
26 51
    public function down()
27
    {
28
        Schema::table('users', function (Blueprint $table) {
29 51
            $table->dropColumn('language');
30 51
        });
31 51
    }
32
}
33