Completed
Pull Request — master (#33)
by Karl
02:24
created

GetUserSearches   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 27
rs 10
c 0
b 0
f 0
ccs 5
cts 5
cp 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A handle() 0 4 1
1
<?php namespace JobApis\JobsToMail\Jobs\Searches;
2
3
use JobApis\JobsToMail\Repositories\Contracts\SearchRepositoryInterface;
4
5
class GetUserSearches
6
{
7
    /**
8
     * @var string $userId
9
     */
10
    protected $userId;
11
12
    /**
13
     * Create a new job instance.
14
     */
15 1
    public function __construct($userId = null)
16
    {
17 1
        $this->userId = $userId;
18 1
    }
19
20
    /**
21
     * Get the searches belonging to this user
22
     *
23
     * @param SearchRepositoryInterface $searches
24
     *
25
     * @return \Illuminate\Database\Eloquent\Collection
26
     */
27 1
    public function handle(SearchRepositoryInterface $searches)
28
    {
29 1
        return $searches->getByUserId($this->userId);
30
    }
31
}
32