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 ( 5ac114...b94542 )
by Toby
04:21
created

CreateRecords   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Test Coverage

Coverage 57.14%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 21
c 2
b 0
f 0
dl 0
loc 39
ccs 12
cts 21
cp 0.5714
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A handle() 0 6 1
A middleware() 0 9 1
A __construct() 0 6 1
A retryUntil() 0 3 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 Illuminate\Queue\InteractsWithQueue;
10
use Spatie\RateLimitedMiddleware\RateLimited;
11
12
class CreateRecords implements ShouldQueue
0 ignored issues
show
Coding Style introduced by
Missing doc comment for class CreateRecords
Loading history...
13
{
14
    use Dispatchable, Queueable, InteractsWithQueue;
15
16
    private array $data;
0 ignored issues
show
Coding Style introduced by
Private member variable "data" must be prefixed with an underscore
Loading history...
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
21 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...
22
    {
23 5
        $this->data = $data;
24 5
        $this->apiKey = $apiKey;
25 5
        $this->baseId = $baseId;
26 5
        $this->tableName = $tableName;
27 5
    }
28
29
    public function middleware()
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function middleware()
Loading history...
30
    {
31
        $rateLimitedMiddleware = (new RateLimited())
32
            ->key('airtable')
33
            ->allow(1)
34
            ->everySeconds(1)
35
            ->releaseAfterSeconds(3);
36
37
        return [$rateLimitedMiddleware];
38
    }
39
    
40 1
    public function handle(AirTable $airTable)
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function handle()
Loading history...
41
    {
42 1
        $airTable->setApiKey($this->apiKey);
43 1
        $airTable->setBaseId($this->baseId);
44 1
        $airTable->setTableName($this->tableName);
45 1
        $airTable->createRows($this->data, true);
46 1
    }
47
48
    public function retryUntil() :  \DateTime
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function retryUntil()
Loading history...
49
    {
50
        return now()->addHours(5);
51
    }
52
53
}