Issues (413)

app/Traits/RelationUserTrait.php (1 issue)

Labels
Severity
1
<?php
2
3
namespace Yeelight\Traits;
4
5
use Yeelight\Models\Foundation\User;
6
7
/**
8
 * Trait RelationUserTrait
9
 *
10
 * @category Yeelight
11
 *
12
 * @package Yeelight\Traits
13
 *
14
 * @author Sheldon Lee <[email protected]>
15
 *
16
 * @license https://opensource.org/licenses/MIT MIT
17
 *
18
 * @link https://www.yeelight.com
19
 */
20
trait RelationUserTrait
21
{
22
    /**
23
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
24
     */
25
    public function user()
26
    {
27
        return $this->belongsTo(User::class, 'user_id', 'user_id');
0 ignored issues
show
It seems like belongsTo() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

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

27
        return $this->/** @scrutinizer ignore-call */ belongsTo(User::class, 'user_id', 'user_id');
Loading history...
28
    }
29
}
30