Model::setJsonImportableRelationsForTests()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 5
rs 10
c 0
b 0
f 0
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