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 ( 726348...b4ed19 )
by Toby
24:13 queued 14:26
created

AirtableHandler   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A save() 0 25 3
1
<?php
2
0 ignored issues
show
Coding Style introduced by
Missing file doc comment
Loading history...
3
namespace BristolSU\AirTable\Control;
4
5
use BristolSU\AirTable\Jobs\CreateRecords;
6
use BristolSU\AirTable\Jobs\FlushRows;
7
use BristolSU\ControlDB\Export\FormattedItem;
8
use BristolSU\ControlDB\Export\Handler\Handler;
9
use Carbon\Carbon;
10
use Illuminate\Support\Collection;
11
12
class AirtableHandler extends Handler
0 ignored issues
show
Coding Style introduced by
Missing doc comment for class AirtableHandler
Loading history...
13
{
14
15
    /**
16
     * Save each item to AirTable
17
     * 
18
     * @param FormattedItem[] $items
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
Coding Style introduced by
Tag value for @param tag indented incorrectly; expected 2 spaces but found 1
Loading history...
19
     * @return mixed|void
0 ignored issues
show
Coding Style introduced by
Tag @return cannot be grouped with parameter tags in a doc comment
Loading history...
20
     */
21 1
    protected function save(array $items)
22
    {
23 1
        $creating = [];
24
        
25 1
        foreach($items as $item) {
0 ignored issues
show
Coding Style introduced by
Expected "foreach (...) {\n"; found "foreach(...) {\n"
Loading history...
26 1
            $creating[] = $item->toArray();
27
        }
28
29 1
        $creatingJobs = [];
30 1
        foreach(array_chunk($creating, 50) as $data) {
0 ignored issues
show
Coding Style introduced by
Expected "foreach (...) {\n"; found "foreach(...) {\n"
Loading history...
31 1
            $creatingJobs[] = new CreateRecords(
32 1
                $data,
33 1
                $this->config('apiKey'),
0 ignored issues
show
Bug introduced by
It seems like $this->config('apiKey') can also be of type null; however, parameter $apiKey of BristolSU\AirTable\Jobs\...eRecords::__construct() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

33
                /** @scrutinizer ignore-type */ $this->config('apiKey'),
Loading history...
34 1
                $this->config('baseId'),
0 ignored issues
show
Bug introduced by
It seems like $this->config('baseId') can also be of type null; however, parameter $baseId of BristolSU\AirTable\Jobs\...eRecords::__construct() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

34
                /** @scrutinizer ignore-type */ $this->config('baseId'),
Loading history...
35 1
                $this->config('tableName')
0 ignored issues
show
Bug introduced by
It seems like $this->config('tableName') can also be of type null; however, parameter $tableName of BristolSU\AirTable\Jobs\...eRecords::__construct() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

35
                /** @scrutinizer ignore-type */ $this->config('tableName')
Loading history...
36
            );
37
        }
38
        
39 1
        dispatch(
40 1
            new FlushRows(
41 1
                $this->config('apiKey'),
0 ignored issues
show
Bug introduced by
It seems like $this->config('apiKey') can also be of type null; however, parameter $apiKey of BristolSU\AirTable\Jobs\FlushRows::__construct() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

41
                /** @scrutinizer ignore-type */ $this->config('apiKey'),
Loading history...
42 1
                $this->config('baseId'),
0 ignored issues
show
Bug introduced by
It seems like $this->config('baseId') can also be of type null; however, parameter $baseId of BristolSU\AirTable\Jobs\FlushRows::__construct() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

42
                /** @scrutinizer ignore-type */ $this->config('baseId'),
Loading history...
43 1
                $this->config('tableName')
0 ignored issues
show
Bug introduced by
It seems like $this->config('tableName') can also be of type null; however, parameter $tableName of BristolSU\AirTable\Jobs\FlushRows::__construct() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

43
                /** @scrutinizer ignore-type */ $this->config('tableName')
Loading history...
44
            )
45 1
        )->chain($creatingJobs);
46
    }
47
}