Passed
Push — master ( ae7f27...efcddf )
by Curtis
06:37
created

Person::boot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace App;
4
5
use NeoEloquent;
0 ignored issues
show
Bug introduced by
The type NeoEloquent 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 Ramsey\Uuid\Uuid;
7
8
class Person extends NeoEloquent
9
{
10
    protected $fillable = ['name'];
11
12
    protected $connection = 'neo4j';
13
14
    public static function boot()
15
    {
16
        parent::boot();
17
18
        static::creating(function ($model) {
19
            $model->uuid = (string) Uuid::uuid4();
20
        });
21
    }
22
23
24
    public function father()
25
    {
26
        return $this->belongsTo('App\Person', 'FATHER');
27
    }
28
29
    public function mother()
30
    {
31
        return $this->belongsTo('App\Person', 'MOTHER');
32
    }
33
}
34