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 ( 91adc2...7a7319 )
by Toby
04:01
created

CreateRecords::middleware()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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