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

getEnvironmentSetUp()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 6
rs 10
1
<?php
2
3
namespace Backpack\CRUD\Tests\config\CrudPanel;
4
5
use Backpack\CRUD\app\Library\CrudPanel\CrudPanel;
6
7
abstract class BaseDBCrudPanelWithSingleton extends BaseDBCrudPanel
8
{
9
    /**
10
     * Setup the test environment.
11
     *
12
     * @return void
13
     */
14
    protected function setUp(): void
15
    {
16
        parent::setUp();
17
18
        $this->crudPanel = app('crud');
0 ignored issues
show
Documentation Bug introduced by
It seems like app('crud') can also be of type Illuminate\Contracts\Foundation\Application or Illuminate\Foundation\Application. However, the property $crudPanel is declared as type Backpack\CRUD\app\Library\CrudPanel\CrudPanel. Maybe add an additional type check?

Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a mixed type is assigned to a property that is type hinted more strictly.

For example, imagine you have a variable $accountId that can either hold an Id object or false (if there is no account id yet). Your code now assigns that value to the id property of an instance of the Account class. This class holds a proper account, so the id value must no longer be false.

Either this assignment is in error or a type check should be added for that assignment.

class Id
{
    public $id;

    public function __construct($id)
    {
        $this->id = $id;
    }

}

class Account
{
    /** @var  Id $id */
    public $id;
}

$account_id = false;

if (starsAreRight()) {
    $account_id = new Id(42);
}

$account = new Account();
if ($account instanceof Id)
{
    $account->id = $account_id;
}
Loading history...
19
    }
20
21
    /**
22
     * Define environment setup.
23
     *
24
     * @param  \Illuminate\Foundation\Application  $app
25
     * @return void
26
     */
27
    protected function getEnvironmentSetUp($app)
28
    {
29
        parent::getEnvironmentSetUp($app);
30
31
        $app->scoped('crud', function () {
32
            return new CrudPanel();
33
        });
34
    }
35
}
36