Completed
Push — master ( b618f7...e48405 )
by Karl
11s
created

GetUserSearches::handle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
ccs 2
cts 2
cp 1
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php namespace JobApis\JobsToMail\Jobs;
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