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

Passed
Branch master (114f68)
by Mark
09:17
created

CreateCarouselsTable   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 55
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A down() 0 7 1
B up() 0 34 1
1
<?php
2
3
use App\Model\Plugin;
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Database\Migrations\Migration;
6
use App\Classes\Repositories\PluginRepository;
7
8
class CreateCarouselsTable extends Migration
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
9
{
10
    /**
11
     * Run the migrations.
12
     *
13
     * @return void
14
     */
15
    public function up()
16
    {
17
        \Schema::create('carousels', function (Blueprint $table) {
18
            $table->increments('id');
19
            $table->string('title');
20
            $table->string('style');
21
            $table->boolean('lock');
22
            $table->unsignedInteger('creator_id');
23
            $table->unsignedInteger('editor_id')->nullable();
24
            $table->softDeletes();
25
            $table->timestamps();
26
        });
27
28
        \Schema::create('carousel_slides', function (Blueprint $table) {
29
            $table->increments('id');
30
            $table->string('title')->nullable();
31
            $table->unsignedInteger('carousel_id');
32
            $table->unsignedInteger('image_id')->nullable();
33
            $table->string('link_url');
34
            $table->string('link_target');
35
            $table->integer('order_id');
36
            $table->unsignedInteger('creator_id');
37
            $table->unsignedInteger('editor_id')->nullable();
38
            $table->softDeletes();
39
            $table->timestamps();
40
        });
41
42
        /** @var Plugin $plugin */
43
        $plugin = new Plugin();
44
        $plugin->setName('carousels');
45
        $plugin->setVersion('1.0');
46
        $plugin->setIcon('fa-fast-forward');
47
        $plugin->setBackEnd(true);
48
        $plugin->save();
49
    }
50
51
    /**
52
     * Reverse the migrations.
53
     *
54
     * @return void
55
     */
56
    public function down()
57
    {
58
        \Schema::drop('carousels');
59
60
        \Schema::drop('carousel_slides');
61
62
        app(PluginRepository::class)->whereName('carousels')->delete();
0 ignored issues
show
Bug introduced by
The method delete() does not exist on stdClass. ( Ignorable by Annotation )

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

62
        app(PluginRepository::class)->whereName('carousels')->/** @scrutinizer ignore-call */ delete();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
63
    }
64
}
65