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 ( 3eac9b )
by Pedro
15:29
created

EnsureLaravelVersionStep::title()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 3
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
use Backpack\CRUD\app\Console\Commands\Upgrade\StepStatus;
8
9
class EnsureLaravelVersionStep extends Step
10
{
11
    public function title(): string
12
    {
13
        return 'Laravel 12 or newer';
14
    }
15
16
    public function run(): StepResult
17
    {
18
        $prettyVersion = $this->context()->installedPackagePrettyVersion('laravel/framework') ?? app()->version();
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

18
        $prettyVersion = $this->context()->installedPackagePrettyVersion('laravel/framework') ?? app()->/** @scrutinizer ignore-call */ version();
Loading history...
19
        $major = $this->context()->packageMajorVersion('laravel/framework');
20
21
        if ($major !== null && $major >= 12) {
22
            return StepResult::success("Detected Laravel {$prettyVersion}.");
23
        }
24
25
        return StepResult::failure(
26
            'Upgrade Laravel to version 12 before continuing.',
27
            ["Detected Laravel version: {$prettyVersion}"]
28
        );
29
    }
30
}
31