PeriodicSentEntry::factory()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
namespace PeriodicNotice\Models;
4
5
use Illuminate\Database\Eloquent\Builder;
6
use Illuminate\Database\Eloquent\Factories\HasFactory;
7
use Illuminate\Database\Eloquent\Model;
8
use Illuminate\Database\Eloquent\Relations\MorphTo;
9
use PeriodicNotice\Factories\PeriodicSentEntryFactory;
10
11
/**
12
 * @property \JsonFieldCast\Json\SimpleJsonField $meta
13
 */
14
class PeriodicSentEntry extends Model
15
{
16
    use HasFactory;
17
18
    protected $guarded = [];
19
20
    protected $casts = [
21
        'meta' => \JsonFieldCast\Casts\SimpleJsonField::class,
22
    ];
23
24 4
    public function getTable(): string
25
    {
26 4
        return config('periodic-notice.tables.periodic_sent_entries');
27
    }
28
29 2
    public function receiver(): MorphTo
30
    {
31 2
        return $this->morphTo();
32
    }
33
34 2
    public function sendable(): MorphTo
35
    {
36 2
        return $this->morphTo();
37
    }
38
39 3
    public function scopeGroup(Builder $query, string|array $group)
40
    {
41 3
        if (is_array($group)) {
0 ignored issues
show
introduced by
The condition is_array($group) is always true.
Loading history...
42 1
            return $query->whereIn('group', $group);
43
        }
44
45 3
        return $query->where('group', '=', $group);
46
    }
47
48 1
    public static function factory(...$parameters): PeriodicSentEntryFactory
0 ignored issues
show
Unused Code introduced by
The parameter $parameters is not used and could be removed. ( Ignorable by Annotation )

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

48
    public static function factory(/** @scrutinizer ignore-unused */ ...$parameters): PeriodicSentEntryFactory

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
49
    {
50 1
        return new PeriodicSentEntryFactory();
51
    }
52
}
53