Issues (177)

src/Concerns/LaruploadRelations.php (2 issues)

Labels
Severity
1
<?php
2
3
namespace Mostafaznv\Larupload\Concerns;
4
5
use Illuminate\Database\Eloquent\Relations\HasMany;
6
use Illuminate\Database\Eloquent\Relations\HasOne;
7
use Mostafaznv\Larupload\Models\LaruploadFFMpegQueue;
8
9
trait LaruploadRelations
10
{
11
    /**
12
     * Retrieve latest status log for ffmpeg queue process
13
     *
14
     * @return HasOne
15
     */
16
    public function laruploadQueue(): HasOne
17
    {
18
        return $this->hasOne(LaruploadFFMpegQueue::class, 'record_id')
0 ignored issues
show
It seems like hasOne() 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

18
        return $this->/** @scrutinizer ignore-call */ hasOne(LaruploadFFMpegQueue::class, 'record_id')
Loading history...
19
            ->where('record_class', self::class)
20
            ->orderByDesc('id');
21
    }
22
23
    /**
24
     * Retrieve all status logs for ffmpeg queue process
25
     *
26
     * @return HasMany
27
     */
28
    public function laruploadQueues(): HasMany
29
    {
30
        return $this->hasMany(LaruploadFFMpegQueue::class, 'record_id')
0 ignored issues
show
It seems like hasMany() 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

30
        return $this->/** @scrutinizer ignore-call */ hasMany(LaruploadFFMpegQueue::class, 'record_id')
Loading history...
31
            ->where('record_class', self::class)
32
            ->orderByDesc('id');
33
    }
34
}
35