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 ( c07b11...b289ea )
by Toby
27:25 queued 11s
created

DeleteRows::__construct()   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
eloc 4
c 1
b 0
f 0
dl 0
loc 6
ccs 5
cts 5
cp 1
rs 10
cc 1
nc 1
nop 4
crap 1
1
<?php
2
0 ignored issues
show
Coding Style introduced by
Missing file doc comment
Loading history...
3
namespace BristolSU\ControlDB\Export\Handler\Airtable;
4
5
use BristolSU\ControlDB\Export\FormattedItem;
6
use GuzzleHttp\Client;
7
use Illuminate\Bus\Queueable;
8
use Illuminate\Contracts\Queue\ShouldQueue;
9
use Illuminate\Foundation\Events\Dispatchable;
10
use Illuminate\Support\Collection;
11
12
class DeleteRows implements ShouldQueue
0 ignored issues
show
Coding Style introduced by
Missing doc comment for class DeleteRows
Loading history...
13
{
14
    use Dispatchable, Queueable;
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
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
21
     * @var Collection
22
     */
23
    private Collection $creatingItems;
0 ignored issues
show
introduced by
The private property $creatingItems is not used, and could be removed.
Loading history...
Coding Style introduced by
Private member variable "creatingItems" must be prefixed with an underscore
Loading history...
24
25
    /**
26
     * CreateRows constructor.
27
     * @param array $data
0 ignored issues
show
Coding Style introduced by
There must be exactly one blank line before the tags in a doc comment
Loading history...
Coding Style introduced by
Missing parameter comment
Loading history...
Coding Style introduced by
Expected 22 spaces after parameter type; 1 found
Loading history...
28
     * @param string $apiKey
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
Coding Style introduced by
Expected 21 spaces after parameter type; 1 found
Loading history...
29
     * @param string $baseId
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
Coding Style introduced by
Expected 21 spaces after parameter type; 1 found
Loading history...
30
     * @param string $tableName
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
Coding Style introduced by
Expected 21 spaces after parameter type; 1 found
Loading history...
31
     * @param Collection|FormattedItem[] $creatingItems
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
Coding Style introduced by
Superfluous parameter comment
Loading history...
32
     */
33 2
    public function __construct(array $data, string $apiKey, string $baseId, string $tableName)
34
    {
35 2
        $this->data = $data;
36 2
        $this->apiKey = $apiKey;
37 2
        $this->baseId = $baseId;
38 2
        $this->tableName = $tableName;
39 2
    }
40
41 1
    public function handle(Client $client)
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function handle()
Loading history...
42
    {
43 1
        $client->delete(
44 1
            sprintf('https://api.airtable.com/v0/%s/%s', $this->baseId, $this->tableName),
45
            [
46 1
                'query' => $this->data,
47
                'headers' => [
48 1
                    'Authorization' => 'Bearer ' . $this->apiKey
49
                ]
50
            ]
51
        );
52 1
    }
53
54
}