Test Failed
Push — main ( 82933d...ebe982 )
by Rafael
02:28
created

Model::exists()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 0
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Alxarafe\Base\Model;
4
5
use Illuminate\Database\Capsule\Manager as DB;
0 ignored issues
show
Bug introduced by
The type Illuminate\Database\Capsule\Manager 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...
6
use Illuminate\Database\Eloquent\Model as EloquentModel;
0 ignored issues
show
Bug introduced by
The type Illuminate\Database\Eloquent\Model 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...
7
8
abstract class Model extends EloquentModel
9
{
10
    public static function exists(): bool
11
    {
12
        $table_name = (new static())->table;
13
        if (empty($table_name)) {
14
            return false;
15
        }
16
        return DB::schema()->hasTable($table_name);
17
    }
18
}
19