Test Failed
Push — master ( 174de6...ef3084 )
by Nur
07:33
created

Like::newFactory()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Turahe\Likeable\Models;
4
5
use Illuminate\Database\Eloquent\Factories\HasFactory;
6
use Illuminate\Database\Eloquent\Model;
7
use Illuminate\Database\Eloquent\Relations\BelongsTo;
8
use Illuminate\Database\Eloquent\Relations\MorphTo;
9
10
11
/**
12
 * Class Like
13
 * @package Turahe\Likeable\Models
14
 */
15
class Like extends Model implements LikeContract
0 ignored issues
show
Bug introduced by
The type Turahe\Likeable\Models\LikeContract 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...
16
{
17
18
    /**
19
     * @var string
20
     */
21
    protected $table = 'likes';
22
    /**
23
     * @var string[]
24
     */
25
    protected $fillable = [
26
        'user_id',
27
        'type_id',
28
    ];
29
30
31
    /**
32
     * @access private
33
     */
34
	public function likeable(): MorphTo
35
	{
36
		return $this->morphTo();
37
	}
38
    /**
39
     * Return the like's author.
40
     */
41
    public function author(): BelongsTo
42
    {
43
        return $this->belongsTo(config('auth.providers.users.model'), 'user_id');
44
    }
45
}
46