Completed
Push — develop ( 0e4d6e...a935b5 )
by Wisoot
02:16
created

CreateJwtClaimsTable   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 1
cbo 2
dl 0
loc 43
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A up() 0 10 1
A down() 0 4 1
1
<?php
2
3
use Illuminate\Database\Schema\Blueprint;
4
use Illuminate\Database\Migrations\Migration;
5
use Illuminate\Support\Facades\Config;
6
use Illuminate\Support\Facades\Schema;
7
8
class CreateJwtClaimsTable extends Migration
9
{
10
11
    /**
12
     * @var string $tableName - Table name.
13
     */
14
    protected $tableName;
15
16
    /**
17
     * Initialise the migration.
18
     */
19
    public function __construct()
20
    {
21
        $this->tableName = Config::get('jwt.claim_table_name');
22
    }
23
24
    /**
25
     * Run the migrations.
26
     *
27
     * @return void
28
     */
29
    public function up()
30
    {
31
        Schema::create($this->tableName, 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...
32
            $table->increments('id');
33
            $table->string('subject')->unsigned();
34
            $table->string('audience')->unsigned();
35
            $table->string('jwt_id')->index();
36
            $table->timestamps();
37
        });
38
    }
39
40
    /**
41
     * Reverse the migrations.
42
     *
43
     * @return void
44
     */
45
    public function down()
46
    {
47
        Schema::drop($this->tableName);
48
    }
49
50
}
51