Model   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 7
c 2
b 0
f 0
dl 0
loc 21
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setJsonImportableRelationsForTests() 0 5 1
A instanceImportForTests() 0 3 1
A setJsonImportableAttributesForTests() 0 5 1
1
<?php
2
3
namespace MathieuTu\JsonSyncer\Tests\Stubs;
4
5
use MathieuTu\JsonSyncer\Helpers\JsonImporter;
6
7
class Model extends \Illuminate\Database\Eloquent\Model
8
{
9
    public $timestamps = false;
10
11
    public function setJsonImportableRelationsForTests($relations)
12
    {
13
        $this->jsonImportableRelations = $relations;
0 ignored issues
show
Bug introduced by
The property jsonImportableRelations does not seem to exist on MathieuTu\JsonSyncer\Tests\Stubs\Model. 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...
14
15
        return $this;
16
    }
17
18
    public function setJsonImportableAttributesForTests($attributes)
19
    {
20
        $this->jsonImportableAttributes = $attributes;
0 ignored issues
show
Bug introduced by
The property jsonImportableAttributes does not seem to exist on MathieuTu\JsonSyncer\Tests\Stubs\Model. 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...
21
22
        return $this;
23
    }
24
25
    public function instanceImportForTests($objects)
26
    {
27
        JsonImporter::importFromJson($this, $objects);
0 ignored issues
show
Bug introduced by
$this of type MathieuTu\JsonSyncer\Tests\Stubs\Model is incompatible with the type MathieuTu\JsonSyncer\Contracts\JsonImportable expected by parameter $importable of MathieuTu\JsonSyncer\Hel...orter::importFromJson(). ( Ignorable by Annotation )

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

27
        JsonImporter::importFromJson(/** @scrutinizer ignore-type */ $this, $objects);
Loading history...
28
    }
29
}
30