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   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 16
c 2
b 0
f 0
dl 0
loc 40
ccs 18
cts 18
cp 1
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 6 2
A register() 0 23 1
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