UnFavAUser   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 50%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 3
dl 0
loc 32
ccs 4
cts 8
cp 0.5
rs 10
c 0
b 0
f 0

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 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