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 ( 2349d2...200536 )
by Simon
04:07
created

ExportEventStore::handle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
namespace SmoothPhp\LaravelAdapter\Console;
3
4
use Illuminate\Console\Command;
5
use Illuminate\Contracts\Config\Repository;
6
use Illuminate\Database\DatabaseManager;
7
8
/**
9
 * Class ExportEventStore
10
 * @package SmoothPhp\LaravelAdapter\Console
11
 * @author Simon Bennett <[email protected]>
12
 */
13
final class ExportEventStore extends Command
14
{
15
    /**
16
     * The name and signature of the console command.
17
     *
18
     * @var string
19
     */
20
    protected $signature = 'smoothphp:export';
21
22
    /**
23
     * The console command description.
24
     *
25
     * @var string
26
     */
27
    protected $description = 'Export EventStore';
28
29
    /** @var DatabaseManager */
30
    private $databaseManager;
31
32
    /** @var Repository */
33
    private $config;
34
35
    /**
36
     * ExportEventStore constructor.
37
     * @param DatabaseManager $databaseManager
38
     * @param Repository $config
39
     */
40
    public function __construct(DatabaseManager $databaseManager, Repository $config)
41
    {
42
        $this->databaseManager = $databaseManager;
43
        parent::__construct();
44
        $this->config = $config;
45
    }
46
47
    /**
48
     * Execute the console command.
49
     *
50
     * @return mixed
51
     */
52
    public function handle()
53
    {
54
        echo json_encode($this->getAllEvents());
55
    }
56
57
    /**
58
     * @return \stdClass
59
     */
60
    private function getAllEvents()
61
    {
62
        return $this->databaseManager
63
            ->connection($this->config->get('cqrses.eventstore_connection'))
64
            ->table($this->config->get('cqrses.eventstore_table'))
65
            ->get();
66
    }
67
}
68