CreateH5pLibrariesTable::up()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 21
Code Lines 19

Duplication

Lines 0
Ratio 0 %

Importance

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

28
            $table->/** @scrutinizer ignore-call */ 
29
                    text('preloaded_js', 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...
29
            $table->text('preloaded_css', 65535)->nullable();
30
            $table->text('drop_library_css', 65535)->nullable();
31
            $table->text('semantics', 65535);
32
            $table->string('tutorial_url', 1023);
33
            $table->integer('has_icon')->unsigned()->default(0);
34
            $table->index(['name', 'major_version', 'minor_version', 'patch_version'], 'name_version');
35
        });
36
    }
37
38
    /**
39
     * Reverse the migrations.
40
     *
41
     * @return void
42
     */
43
    public function down()
44
    {
45
        Schema::drop('h5p_libraries');
46
    }
47
}
48