CreateH5pLibrariesHubCacheTable::up()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 26
Code Lines 24

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
eloc 24
nc 1
nop 0
dl 0
loc 26
c 1
b 1
f 0
cc 1
rs 9.536
1
<?php
2
3
use Illuminate\Database\Migrations\Migration;
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Support\Facades\Schema;
6
7
class CreateH5pLibrariesHubCacheTable extends Migration
8
{
9
    /**
10
     * Run the migrations.
11
     *
12
     * @return void
13
     */
14
    public function up()
15
    {
16
        Schema::create('h5p_libraries_hub_cache', function (Blueprint $table) {
17
            $table->bigIncrements('id');
18
            $table->string('machine_name', 127);
19
            $table->bigInteger('major_version')->unsigned();
20
            $table->bigInteger('minor_version')->unsigned();
21
            $table->bigInteger('patch_version')->unsigned();
22
            $table->bigInteger('h5p_major_version')->unsigned()->nullable();
23
            $table->bigInteger('h5p_minor_version')->unsigned()->nullable();
24
            $table->string('title');
25
            $table->text('summary', 65535);
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

25
            $table->/** @scrutinizer ignore-call */ 
26
                    text('summary', 65535);

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...
26
            $table->text('description', 65535);
27
            $table->string('icon', 511);
28
            $table->bigInteger('created_at')->unsigned();
29
            $table->bigInteger('updated_at')->unsigned();
30
            $table->bigInteger('is_recommended')->unsigned();
31
            $table->bigInteger('popularity')->unsigned();
32
            $table->text('screenshots', 65535)->nullable();
33
            $table->string('license', 511)->nullable();
34
            $table->string('example', 511);
35
            $table->string('tutorial', 511)->nullable();
36
            $table->text('keywords', 65535)->nullable();
37
            $table->text('categories', 65535)->nullable();
38
            $table->string('owner', 511)->nullable();
39
            $table->index(['machine_name', 'major_version', 'minor_version', 'patch_version'], 'name_version');
40
        });
41
    }
42
43
    /**
44
     * Reverse the migrations.
45
     *
46
     * @return void
47
     */
48
    public function down()
49
    {
50
        Schema::drop('h5p_libraries_hub_cache');
51
    }
52
}
53