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 — add-update-command ( a799e0...85addd )
by Cristian
30:23 queued 15:39
created

EnsureLaravelVersionStep::isBlocking()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
cc 1
rs 10
1
<?php
2
3
namespace Backpack\CRUD\app\Console\Commands\Upgrade\v7\Steps;
4
5
use Backpack\CRUD\app\Console\Commands\Upgrade\Step;
6
use Backpack\CRUD\app\Console\Commands\Upgrade\StepResult;
7
8
class EnsureLaravelVersionStep extends Step
9
{
10
    public function title(): string
11
    {
12
        return 'Check if Laravel version 12 or higher is installed';
13
    }
14
15
    public function run(): StepResult
16
    {
17
        $prettyVersion = $this->context()->installedPackagePrettyVersion('laravel/framework') ?? app()->version();
18
        $major = $this->context()->packageMajorVersion('laravel/framework');
19
20
        if ($major === null && preg_match('/(\d+)/', $prettyVersion, $matches)) {
21
            $major = (int) $matches[1];
22
        }
23
24
        if ($major !== null && $major >= 12) {
25
            return StepResult::success("Detected Laravel {$prettyVersion}.");
26
        }
27
28
        return StepResult::failure(
29
            'Upgrade to Laravel 12 before running the Backpack v7 upgrade.',
30
            [
31
                "Detected Laravel version: {$prettyVersion}",
32
                'Follow the official upgrade guide: https://laravel.com/docs/12.x/upgrade',
33
                'After upgrading to Laravel 12, test everything is working in your app and admin panel.
34
            ]
35
        );
36
    }
37
38
    public function isBlocking(): bool
39
    {
40
        return true;
41
    }
42
}
43