SongLikeToggled::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 2
c 0
b 0
f 0
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 2
nc 1
nop 2
crap 2
1
<?php
2
3
namespace App\Events;
4
5
use App\Models\Interaction;
6
use App\Models\User;
7
use Illuminate\Queue\SerializesModels;
8
9
class SongLikeToggled extends Event
10
{
11
    use SerializesModels;
0 ignored issues
show
introduced by
The trait Illuminate\Queue\SerializesModels requires some properties which are not provided by App\Events\SongLikeToggled: $id, $relations, $class, $connection, $keyBy
Loading history...
12
13
    public $interaction;
14
    public $user;
15
16 6
    public function __construct(Interaction $interaction, User $user = null)
17
    {
18 6
        $this->interaction = $interaction;
19 6
        $this->user = $user ?: auth()->user();
20 6
    }
21
}
22