Completed
Push — master ( d1abb9...2c5b6e )
by Ricardo
02:02
created

CreateOauthPersonalAccessClientsTable   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 0
Metric Value
dl 0
loc 53
rs 10
c 0
b 0
f 0
wmc 4
lcom 1
cbo 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A up() 0 8 1
A down() 0 4 1
A getConnection() 0 4 1
1
<?php
2
3
use Illuminate\Database\Migrations\Migration;
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Support\Facades\Schema;
6
7
class CreateOauthPersonalAccessClientsTable extends Migration
8
{
9
    /**
10
     * The database schema.
11
     *
12
     * @var \Illuminate\Database\Schema\Builder
13
     */
14
    protected $schema;
15
16
    /**
17
     * Create a new migration instance.
18
     *
19
     * @return void
0 ignored issues
show
Comprehensibility Best Practice introduced by
Adding a @return annotation to constructors is generally not recommended as a constructor does not have a meaningful return value.

Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.

Please refer to the PHP core documentation on constructors.

Loading history...
20
     */
21
    public function __construct()
22
    {
23
        $this->schema = Schema::connection($this->getConnection());
24
    }
25
26
    /**
27
     * Run the migrations.
28
     *
29
     * @return void
30
     */
31
    public function up()
32
    {
33
        $this->schema->create('oauth_personal_access_clients', function (Blueprint $table) {
34
            $table->bigIncrements('id');
35
            $table->unsignedBigInteger('client_id');
36
            $table->timestamps();
37
        });
38
    }
39
40
    /**
41
     * Reverse the migrations.
42
     *
43
     * @return void
44
     */
45
    public function down()
46
    {
47
        $this->schema->dropIfExists('oauth_personal_access_clients');
48
    }
49
50
    /**
51
     * Get the migration connection name.
52
     *
53
     * @return string|null
54
     */
55
    public function getConnection()
56
    {
57
        return config('passport.storage.database.connection');
58
    }
59
}
60