VirtualModelViewProvider   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 1
c 1
b 1
f 0
lcom 1
cbo 4
dl 0
loc 19
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 11 1
1
<?php
2
3
namespace AlgoWeb\ModelViews\Providers;
4
5
use AlgoWeb\ModelViews\Database\MysqlVirtualConnection;
6
use Illuminate\Database\Connectors\MySqlConnector;
7
use Illuminate\Database\MySqlConnection;
8
use Illuminate\Support\Facades\App;
9
use Illuminate\Support\Facades\Auth;
10
use Illuminate\Support\ServiceProvider;
11
12
class VirtualModelViewProvider extends ServiceProvider
13
{
14
    /**
15
     * Register the service provider.
16
     *
17
     * @return void
18
     */
19
    public function register()
20
    {
21
        $this->app->singleton('db.connection.virtual', function ($app, $parameters) {
22
            list($connection, $database, $prefix, $config) = $parameters;
23
            return new MysqlVirtualConnection($connection, $database, $prefix, $config);
24
        });
25
26
        $this->app->singleton('db.connector.virtual', function ($app, $parameters) {
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $parameters is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
27
            return new MySqlConnector();
28
        });
29
    }
30
}
31