BaseModel   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 2
eloc 5
c 3
b 0
f 0
dl 0
loc 14
ccs 6
cts 6
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getRows() 0 3 1
1
<?php
2
3
namespace TarfinLabs\Parasut\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
use Sushi\Sushi;
7
8
class BaseModel extends Model
9
{
10
    use Sushi;
0 ignored issues
show
introduced by
The trait Sushi\Sushi requires some properties which are not provided by TarfinLabs\Parasut\Models\BaseModel: $schema, $class, $rows
Loading history...
11
12 10
    public function __construct(array $attributes = [])
13
    {
14 10
        parent::__construct($attributes);
15
16 10
        $this->fillable = array_keys($this->schema);
0 ignored issues
show
Bug introduced by
The property schema does not seem to exist on TarfinLabs\Parasut\Models\BaseModel. Are you sure there is no database migration missing?

Checks if undeclared accessed properties appear in database migrations and if the creating migration is correct.

Loading history...
17 10
    }
18
19 10
    public function getRows(): array
20
    {
21 10
        return [array_merge(['id' => 'integer'], $this->schema)];
0 ignored issues
show
Bug introduced by
The property schema does not seem to exist on TarfinLabs\Parasut\Models\BaseModel. Are you sure there is no database migration missing?

Checks if undeclared accessed properties appear in database migrations and if the creating migration is correct.

Loading history...
22
    }
23
}
24