Completed
Push — master ( c57890...8e558a )
by Rudy
12:11 queued 02:27
created

UnFavAUser   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 1
cbo 3
dl 0
loc 32
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A handle() 0 5 1
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
    public function __construct($userID, $userIDToUnFav)
28
    {
29
        $this->userID = $userID;
30
        $this->userIDToUnFav = $userIDToUnFav;
31
    }
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