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.
Completed
Push — master ( 9ae1b6...7b2ad3 )
by Simon
04:38
created

RebuildProjectionsCommand::dispatchEvent()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

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