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 ( cf8c68...b1d3e5 )
by Christian
06:28 queued 02:45
created

EnigmaServiceProvider::boot()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 4
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 6
ccs 5
cts 5
cp 1
crap 2
rs 10
1
<?php
2
3
namespace Omatech\Enigma;
4
5
use Illuminate\Database\Connection;
6
use Illuminate\Support\ServiceProvider;
7
use Omatech\Enigma\Commands\ReIndexCommand;
8
use Omatech\Enigma\Database\Contracts\DBInterface;
9
use Omatech\Enigma\Database\Eloquent\DB;
10
use Omatech\Enigma\Database\MySqlConnection;
11
use Omatech\Enigma\Database\PostgresConnection;
12
use Omatech\Enigma\Database\SQLiteConnection;
13
use Omatech\Enigma\Database\SqlServerConnection;
14
15
class EnigmaServiceProvider extends ServiceProvider
16
{
17
    /**
18
     * Bootstrap the application services.
19
     */
20 51
    public function boot()
21
    {
22 51
        if ($this->app->runningInConsole()) {
23 51
            $this->publishes([
24 51
                __DIR__.'/../config/config.php' => config_path('enigma.php'),
25 51
            ], 'config');
26
        }
27 51
    }
28
29
    /**
30
     * Register the application services.
31
     */
32 51
    public function register(): void
33
    {
34 51
        app()->singleton(DBInterface::class, DB::class);
35
36
        Connection::resolverFor('mysql', static function ($connection, $database, $prefix, $config) {
37 15
            return new MySqlConnection($connection, $database, $prefix, $config);
38 51
        });
39
40
        Connection::resolverFor('pgsql', static function ($connection, $database, $prefix, $config) {
41 12
            return new PostgresConnection($connection, $database, $prefix, $config);
42 51
        });
43
44
        Connection::resolverFor('sqlite', static function ($connection, $database, $prefix, $config) {
45 12
            return new SQLiteConnection($connection, $database, $prefix, $config);
46 51
        });
47
48
        Connection::resolverFor('sqlsrv', static function ($connection, $database, $prefix, $config) {
49 12
            return new SqlServerConnection($connection, $database, $prefix, $config);
50 51
        });
51
52 51
        $this->commands(ReIndexCommand::class);
53
54 51
        $this->mergeConfigFrom(__DIR__.'/../config/config.php', 'enigma');
55 51
    }
56
}
57