Test Failed
Pull Request — master (#157)
by
unknown
14:40
created

CleanLastId   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 29
ccs 9
cts 9
cp 1
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 2 1
A title() 0 3 1
A estimate() 0 3 1
A handle() 0 4 1
1
<?php
2
3
namespace Matchish\ScoutElasticSearch\Jobs\Stages;
4
5
use Elasticsearch\Client;
6
use Elasticsearch\Common\Exceptions\Missing404Exception;
7
use Illuminate\Support\Facades\Cache;
8
use Matchish\ScoutElasticSearch\ElasticSearch\Params\Indices\Alias\Get as GetAliasParams;
9
use Matchish\ScoutElasticSearch\ElasticSearch\Params\Indices\Delete as DeleteIndexParams;
10
use Matchish\ScoutElasticSearch\Searchable\ImportSource;
11
12
/**
13
 * @internal
14
 */
15
final class CleanLastId
16
{
17
    /**
18
     * @var ImportSource
19
     */
20
    private $source;
0 ignored issues
show
introduced by
The private property $source is not used, and could be removed.
Loading history...
21
22
    /**
23
     * @param ImportSource $source
24
     */
25 15
    public function __construct()
26
    {
27
28 15
    }
29
30 13
    public function handle(Client $elasticsearch): void
0 ignored issues
show
Unused Code introduced by
The parameter $elasticsearch is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

30
    public function handle(/** @scrutinizer ignore-unused */ Client $elasticsearch): void

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
31
    {
32
        // Clean Last id
33 13
        Cache::forget('scout_import_last_id');
34 13
    }
35
36 13
    public function title(): string
37
    {
38 13
        return 'Clean Last Id';
39
    }
40
41 13
    public function estimate(): int
42
    {
43 13
        return 1;
44
    }
45
}
46