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.

RebuildProjectionsCommand::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace SmoothPhp\LaravelAdapter\Console;
4
5
use Illuminate\Console\Command;
6
use Illuminate\Contracts\Config\Repository;
7
use SmoothPhp\Serialization\Exception\SerializedClassDoesNotExist;
8
9
/**
10
 * Class RebuildProjectionsCommand
11
 * @package SmoothPhp\LaravelAdapter\Console
12
 * @author Simon Bennett <[email protected]>
13
 */
14
final class RebuildProjectionsCommand extends Command
15
{
16
    /**
17
     * The name and signature of the console command.
18
     *
19
     * @var string
20
     */
21
    protected $signature = 'smoothphp:rebuild {--transactions}';
22
23
    /**
24
     * The console command description.
25
     *
26
     * @var string
27
     */
28
    protected $description = 'Rebuild all projection';
29
30
    /** @var Repository */
31
    private $config;
32
33
    /**
34
     * BuildLaravelEventStore constructor.
35
     * @param Repository $config
36
     */
37
    public function __construct(Repository $config)
38
    {
39
        parent::__construct();
40
        $this->config = $config;
41
    }
42
43
    /**
44
     * Execute the console command.
45
     *
46
     * @return mixed
47
     */
48
    public function handle()
49
    {
50
        foreach ($this->config->get('cqrses.pre_rebuild_commands') as $preRebuildCommand) {
51
            if (is_array($preRebuildCommand)) {
52
                $this->call(key($preRebuildCommand), current($preRebuildCommand));
53
            } else {
54
                $this->call($preRebuildCommand);
55
            }
56
        }
57
58
        $this->call(
59
            'smoothphp:project',
60
            [
61
                'projections'  => implode(',', $this->config->get('cqrses.rebuild_projections')),
62
                '--transactions' => $this->option('transactions'),
63
            ]
64
        );
65
66
        foreach ($this->config->get('cqrses.post_rebuild_commands') as $postRebuildCommand) {
67
            if (is_array($postRebuildCommand)) {
68
                $this->call(key($postRebuildCommand), current($postRebuildCommand));
69
            } else {
70
                $this->call($postRebuildCommand);
71
            }
72
        }
73
    }
74
}
75