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.

Issues (187)

src/Control/AirtableHandler.php (20 issues)

1
<?php
2
0 ignored issues
show
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
use Illuminate\Support\Facades\Log;
12
13
class AirtableHandler extends Handler
0 ignored issues
show
Missing doc comment for class AirtableHandler
Loading history...
14
{
15
16
    /**
17
     * Save each item to AirTable
18
     * 
19
     * @param FormattedItem[] $items
0 ignored issues
show
Missing parameter comment
Loading history...
Tag value for @param tag indented incorrectly; expected 2 spaces but found 1
Loading history...
20
     * @return mixed|void
0 ignored issues
show
Tag @return cannot be grouped with parameter tags in a doc comment
Loading history...
21
     */
22 1
    protected function save(array $items)
23
    {
24 1
        $creating = [];
25
        
26 1
        foreach($items as $item) {
0 ignored issues
show
Expected "foreach (...) {\n"; found "foreach(...) {\n"
Loading history...
27 1
            $creating[] = $item->toArray();
28
        }
29
30 1
        $this->log('Flushing rows');
31
        
32 1
        dispatch_now(
33 1
            (new FlushRows(
34 1
                $this->config('apiKey'),
0 ignored issues
show
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

34
                /** @scrutinizer ignore-type */ $this->config('apiKey'),
Loading history...
35 1
                $this->config('baseId'),
0 ignored issues
show
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

35
                /** @scrutinizer ignore-type */ $this->config('baseId'),
Loading history...
36 1
                $this->config('tableName')
0 ignored issues
show
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

36
                /** @scrutinizer ignore-type */ $this->config('tableName')
Loading history...
37 1
            ))->withDebug($this->config('debug', false))
0 ignored issues
show
It seems like $this->config('debug', false) can also be of type null; however, parameter $debug of BristolSU\AirTable\Jobs\FlushRows::withDebug() does only seem to accept boolean, 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

37
            ))->withDebug(/** @scrutinizer ignore-type */ $this->config('debug', false))
Loading history...
38
        );
39
40 1
        $this->log('Flushed rows. Creating records');
41
42
43 1
        foreach(array_chunk($creating, 10) as $data) {
0 ignored issues
show
Expected "foreach (...) {\n"; found "foreach(...) {\n"
Loading history...
44 1
            dispatch((new CreateRecords(
0 ignored issues
show
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
45 1
                $data,
46 1
                $this->config('apiKey'),
0 ignored issues
show
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

46
                /** @scrutinizer ignore-type */ $this->config('apiKey'),
Loading history...
47 1
                $this->config('baseId'),
0 ignored issues
show
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

47
                /** @scrutinizer ignore-type */ $this->config('baseId'),
Loading history...
48 1
                $this->config('tableName')
0 ignored issues
show
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

48
                /** @scrutinizer ignore-type */ $this->config('tableName')
Loading history...
49 1
            ))->withDebug($this->config('debug', false)));
0 ignored issues
show
It seems like $this->config('debug', false) can also be of type null; however, parameter $debug of BristolSU\AirTable\Jobs\CreateRecords::withDebug() does only seem to accept boolean, 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

49
            ))->withDebug(/** @scrutinizer ignore-type */ $this->config('debug', false)));
Loading history...
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
50
        }
51
52 1
        $this->log('Created Records');
53
54 1
    }
55
56 1
    private function log(string $string)
0 ignored issues
show
Private method name "AirtableHandler::log" must be prefixed with an underscore
Loading history...
Missing doc comment for function log()
Loading history...
57
    {
58 1
        if($this->config('debug', false)) {
0 ignored issues
show
Expected "if (...) {\n"; found "if(...) {\n"
Loading history...
59
            Log::debug($string);
60
        }
61 1
    }
62
}
63