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   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Test Coverage

Coverage 61.11%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 20
c 1
b 0
f 0
dl 0
loc 34
ccs 11
cts 18
cp 0.6111
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A handle() 0 6 1
A middleware() 0 9 1
A __construct() 0 6 1
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
}