UnFavAUser::handle()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 0
cts 4
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
crap 2
1
<?php
2
3
namespace CTL\SocialMapFavorites\Jobs;
4
5
use Core\Users\UsersOrigin;
6
use CTL\SocialMapFavorites\Jobs\Job;
7
use Illuminate\Queue\SerializesModels;
8
use Illuminate\Queue\InteractsWithQueue;
9
use Illuminate\Contracts\Queue\ShouldQueue;
10
11
class UnFavAUser extends Job implements ShouldQueue
12
{
13
14
    use InteractsWithQueue, SerializesModels;
15
16
17
18
    public $userID;
19
20
    public $userIDToUnFav;
21
22
23
    /**
24
     * Create a new command instance.
25
     *
26
     */
27 3
    public function __construct($userID, $userIDToUnFav)
28
    {
29 3
        $this->userID = $userID;
30 3
        $this->userIDToUnFav = $userIDToUnFav;
31 3
    }
32
33
    /**
34
     * Execute the command.
35
     *
36
     */
37
    public function handle(UsersOrigin $UsersOrigin)
38
    {
39
        $unFav = $UsersOrigin->findById($this->userID);
40
        $UsersOrigin->unfavoriteUser($this->userIDToUnFav, $unFav);
41
    }
42
}
43