GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Push — master ( de4da9...729ed9 )
by Toby
05:17
created

DeleteRows::handle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 6
ccs 5
cts 5
cp 1
crap 1
rs 10
1
<?php
2
0 ignored issues
show
Coding Style introduced by
Missing file doc comment
Loading history...
3
4
namespace BristolSU\AirTable\Jobs;
5
6
7
use BristolSU\AirTable\AirTable;
8
use Illuminate\Bus\Queueable;
9
use Illuminate\Contracts\Queue\ShouldQueue;
10
use Illuminate\Foundation\Bus\Dispatchable;
11
use Spatie\RateLimitedMiddleware\RateLimited;
12
13
class DeleteRows implements ShouldQueue
0 ignored issues
show
Coding Style introduced by
Missing doc comment for class DeleteRows
Loading history...
14
{
15
    use Dispatchable, Queueable;
16
17
    private string $apiKey;
0 ignored issues
show
Coding Style introduced by
Private member variable "apiKey" must be prefixed with an underscore
Loading history...
18
    private string $baseId;
0 ignored issues
show
Coding Style introduced by
Private member variable "baseId" must be prefixed with an underscore
Loading history...
19
    private string $tableName;
0 ignored issues
show
Coding Style introduced by
Private member variable "tableName" must be prefixed with an underscore
Loading history...
20
    private array $ids;
0 ignored issues
show
Coding Style introduced by
Private member variable "ids" must be prefixed with an underscore
Loading history...
21
22 2
    public function __construct(array $ids
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function __construct()
Loading history...
23
        , string $apiKey, string $baseId, string $tableName)
0 ignored issues
show
Coding Style introduced by
The closing parenthesis of a multi-line function declaration must be on a new line
Loading history...
24
    {
0 ignored issues
show
Coding Style introduced by
The closing parenthesis and the opening brace of a multi-line function declaration must be on the same line
Loading history...
25 2
        $this->apiKey = $apiKey;
26 2
        $this->baseId = $baseId;
27 2
        $this->tableName = $tableName;
28 2
        $this->ids = $ids;
29 2
    }
30
31
    public function middleware()
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function middleware()
Loading history...
32
    {
33
        $rateLimitedMiddleware = (new RateLimited())
34
            ->key('airtable')
35
            ->allow(1)
36
            ->everySeconds(1)
37
            ->releaseAfterSeconds(3);
38
39
        return [$rateLimitedMiddleware];
40
    }
41
42 1
    public function handle(AirTable $airTable)
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function handle()
Loading history...
43
    {
44 1
        $airTable->setApiKey($this->apiKey);
45 1
        $airTable->setBaseId($this->baseId);
46 1
        $airTable->setTableName($this->tableName);
47 1
        $airTable->deleteRows($this->ids);
48 1
    }
49
50
    public function retryUntil() :  \DateTime
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function retryUntil()
Loading history...
51
    {
52
        return now()->addHours(5);
53
    }
54
}