DatastoreComments   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 32
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A replies() 0 3 1
A user() 0 3 1
1
<?php
2
3
namespace Phpsa\Datastore\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
use Illuminate\Database\Eloquent\SoftDeletes;
7
use App\Models\Auth\User;
0 ignored issues
show
Bug introduced by
The type App\Models\Auth\User 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...
8
9
class DatastoreComments extends Model
10
{
11
12
    use SoftDeletes;
13
14
    protected $dates = ['deleted_at'];
15
16
    /**
17
     * The attributes that are mass assignable.
18
     *
19
     * @var array
20
     */
21
    protected $fillable = ['user_id', 'datastore_id', 'parent_id', 'body'];
22
23
    /**
24
     * The belongs to Relationship
25
     *
26
     * @var array
27
     */
28
    public function user()
29
    {
30
        return $this->belongsTo(User::class);
31
    }
32
33
    /**
34
     * The has Many Relationship
35
     *
36
     * @var array
37
     */
38
    public function replies()
39
    {
40
        return $this->hasMany(DatastoreComments::class, 'parent_id');
41
    }
42
43
}