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

Test Setup Failed
Pull Request — master (#4294)
by Martin Selim
10:32
created

CrudTrait::scopeWithTrashedFiltered()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 3
nc 2
nop 1
dl 0
loc 6
rs 10
c 1
b 0
f 0
1
<?php
2
3
namespace Backpack\CRUD\app\Models\Traits;
4
5
use Illuminate\Support\Facades\Schema;
6
7
trait CrudTrait
8
{
9
    use HasIdentifiableAttribute;
10
    use HasEnumFields;
11
    use HasRelationshipFields;
12
    use HasUploadFields;
13
    use HasFakeFields;
14
    use HasTranslatableFields;
15
16
    public static function hasCrudTrait()
17
    {
18
        return true;
19
    }
20
    
21
    /**
22
     * @return string
23
     */
24
    public static function getTableName(): string
25
    {
26
        return with(new static)->getTable();
0 ignored issues
show
Bug introduced by
The method getTable() does not exist on Backpack\CRUD\app\Models\Traits\CrudTrait. Did you maybe mean getTableName()? ( Ignorable by Annotation )

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

26
        return with(new static)->/** @scrutinizer ignore-call */ getTable();

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...
27
    }
28
29
    /**
30
     * @param $query
31
     * @return mixed
32
     */
33
    public static function scopeWithTrashedFiltered($query)
34
    {
35
        if (Schema::hasColumn(self::getTableName(), 'deleted_at')) {
36
            $query->withTrashed();
37
        }
38
        return $query;
39
    }
40
}
41