Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

CreateLinksTable::down()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 1
b 0
f 0
1
<?php
2
3
use App\Model\Link;
4
use App\Model\Menu;
5
use App\Model\Page;
6
use Illuminate\Support\Facades\Schema;
7
use Illuminate\Database\Schema\Blueprint;
8
use App\Classes\Repositories\MenuRepository;
9
use App\Classes\Repositories\PageRepository;
10
use Illuminate\Database\Migrations\Migration;
11
12
class CreateLinksTable extends Migration
13
{
14
    /**
15
     * Run the migrations.
16
     *
17
     * @return void
18
     */
19
    public function up()
20
    {
21
        Schema::create('links', function (Blueprint $table) {
22
            $table->increments('id');
23
24
            $table->unsignedInteger('from_id');
25
            $table->string('from_type');
26
            $table->index(['from_id', 'from_type']);
27
28
            $table->unsignedInteger('to_id')->nullable();
29
            $table->string('to_type')->nullable();
30
            $table->index(['to_id', 'to_type']);
31
32
            $table->string('external')->nullable();
33
34
            $table->timestamps();
35
        });
36
37
        Schema::table('menus', function (Blueprint $table) {
38
            $table->removeColumn('hyperlink');
39
40
            $table->removeColumn('page_id');
41
        });
42
43
        /**
44
         * Link the homepage menu to the homepage page.
45
         */
46
        $page = app(PageRepository::class)->whereID(1);
47
        $menu = app(MenuRepository::class)->whereID(1);
48
49
        /** @var Link $link */
50
        $link = app(Link::class);
51
52
        $link->connect($menu, $page)->save();
0 ignored issues
show
Bug introduced by
$page of type App\Model\Menu is incompatible with the type null|App\Classes\Interfaces\Linkable expected by parameter $object of App\Model\Link::connect(). ( Ignorable by Annotation )

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

52
        $link->connect($menu, /** @scrutinizer ignore-type */ $page)->save();
Loading history...
53
    }
54
55
    /**
56
     * Reverse the migrations.
57
     *
58
     * @return void
59
     */
60
    public function down()
61
    {
62
        Schema::dropIfExists('links');
63
    }
64
}
65