FavAUser   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
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 33
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
12
class FavAUser extends Job implements ShouldQueue
13
{
14
15
    use InteractsWithQueue, SerializesModels;
16
17
18
19
    public $userID;
20
21
    public $userIDToFav;
22
23
    /**
24
     * Create a new command instance.
25
     *
26
     */
27 3
    public function __construct($userID, $userIDToFav)
28
    {
29 3
        $this->userID = $userID;
30 3
        $this->userIDToFav = $userIDToFav;
31 3
    }
32
33
    /**
34
     * Execute the command.
35
     *
36
     */
37
    public function handle(UsersOrigin $UsersOrigin)
38
    {
39
        $fav = $UsersOrigin->findById($this->userID);
40
        $UsersOrigin->favoriteUser($this->userIDToFav, $fav);
41
    }
42
43
44
}
45