ArangoServiceProvider   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 18 1
1
<?php
2
/**
3
 * @author Donii Sergii <[email protected]>
4
 */
5
6
namespace sonrac\Arango;
7
8
use Illuminate\Database\Connection as IlluminateConnection;
9
use Illuminate\Support\ServiceProvider;
10
11
/**
12
 * Class ArangoServiceProvider.
13
 *
14
 * @author  Donii Sergii <[email protected]>
15
 */
16
class ArangoServiceProvider extends ServiceProvider
17
{
18
    /**
19
     * Register the service provider.
20
     */
21
    public function register()
22
    {
23
        // Add database driver.
24
        $this->app->singleton('arangodb.connection', function ($app) {
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...
25
            $config = config('database.connections.arangodb');
26
            return new Connection($config);
27
        });
28
29
        IlluminateConnection::resolverFor('arangodb', function ($config) {
0 ignored issues
show
Unused Code introduced by
The parameter $config 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...
30
            return app('arangodb.connection');
31
        });
32
33
        $this->app->resolving('db', function ($db) {
34
            $db->extend('arangodb', function ($config) {
0 ignored issues
show
Unused Code introduced by
The parameter $config 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...
35
                return app('arangodb.connection');
36
            });
37
        });
38
    }
39
}
40