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
Push — main ( 01e961...4be8bd )
by Pedro
01:45 queued 15s
created

RequireDevTools::isInstalled()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Backpack\CRUD\app\Console\Commands\Addons;
4
5
use Illuminate\Console\Command;
6
7
class RequireDevTools extends Command
8
{
9
    use \Backpack\CRUD\app\Console\Commands\Traits\PrettyCommandOutput;
0 ignored issues
show
introduced by
The trait Backpack\CRUD\app\Consol...its\PrettyCommandOutput requires some properties which are not provided by Backpack\CRUD\app\Consol...\Addons\RequireDevTools: $progressBar, $statusColor, $status
Loading history...
10
    use \Backpack\CRUD\app\Console\Commands\Traits\AddonsHelper;
0 ignored issues
show
Bug introduced by
The trait Backpack\CRUD\app\Consol...nds\Traits\AddonsHelper requires the property $repositories which is not provided by Backpack\CRUD\app\Consol...\Addons\RequireDevTools.
Loading history...
11
12
    /**
13
     * The name and signature of the console command.
14
     *
15
     * @var string
16
     */
17
    protected $signature = 'backpack:require:devtools
18
                                {--debug} : Show process output or not. Useful for debugging.';
19
20
    /**
21
     * The console command description.
22
     *
23
     * @var string
24
     */
25
    protected $description = 'Require Backpack DevTools on dev';
26
27
    /**
28
     * Backpack addons install attribute.
29
     *
30
     * @var array
31
     */
32
    public static $addon = [
33
        'name'        => 'DevTools',
34
        'description' => [
35
            'Helps generate models, migrations, operations and CRUDs',
36
        ],
37
        'path'    => 'vendor/backpack/devtools',
38
        'command' => 'backpack:require:devtools',
39
    ];
40
41
    /**
42
     * Execute the console command.
43
     *
44
     * @return mixed Command-line output
45
     */
46
    public function handle()
47
    {
48
        // Prevent installations in laravel 10 as it wouldn't properly work. Waiting for Blueprint L10 support.
49
        if (app()->version() >= 10) {
0 ignored issues
show
introduced by
The method version() does not exist on Illuminate\Container\Container. Are you sure you never get this type here, but always one of the subclasses? ( Ignorable by Annotation )

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

49
        if (app()->/** @scrutinizer ignore-call */ version() >= 10) {
Loading history...
50
            $this->newLine();
51
            $this->line(sprintf('Support for Laravel 10 is comming soon. Sorry for the trouble.'), 'fg=red');
52
            $this->newLine();
53
54
            return;
55
        }
56
57
        // Check if it is installed
58
        if ($this->isInstalled()) {
59
            $this->newLine();
60
            $this->line(sprintf('  %s was already installed', self::$addon['name']), 'fg=red');
61
            $this->newLine();
62
63
            return;
64
        }
65
66
        $this->newLine();
67
        $this->infoBlock('Connecting to the Backpack add-on repository');
68
69
        // Check if repositories exists
70
        $this->composerRepositories();
71
72
        // Check for authentication
73
        $this->checkForAuthentication();
74
75
        $this->newLine();
76
        $this->progressBlock($this->description);
77
78
        // Require package
79
        try {
80
            $this->composerRequire('backpack/devtools', ['--dev', '--with-all-dependencies']);
81
        } catch (\Throwable $e) {
82
            $this->errorProgressBlock();
83
            $this->line('  '.$e->getMessage(), 'fg=red');
84
            $this->newLine();
85
86
            return;
87
        }
88
89
        // Display general error in case it failed
90
        if (! $this->isInstalled()) {
91
            $this->errorProgressBlock();
92
            $this->note('For further information please check the log file.');
93
            $this->note('You can also follow the manual installation process documented in https://backpackforlaravel.com/addons/');
94
            $this->newLine();
95
96
            return;
97
        }
98
99
        // Finish
100
        $this->closeProgressBlock();
101
        $this->newLine();
102
103
        // manually include the command in the run-time
104
        if (! class_exists(\Backpack\DevTools\Console\Commands\InstallDevTools::class)) {
0 ignored issues
show
Bug introduced by
The type Backpack\DevTools\Console\Commands\InstallDevTools was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
105
            include base_path('vendor/backpack/devtools/src/Console/Commands/InstallDevTools.php');
106
        }
107
108
        $this->call(\Backpack\DevTools\Console\Commands\InstallDevTools::class);
109
    }
110
111
    public function isInstalled()
112
    {
113
        return file_exists(self::$addon['path'].'/composer.json');
114
    }
115
}
116