Test Setup Failed
Push — master ( b9960b...b23bbe )
by Roman
01:42
created

CassandraServiceProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 4
dl 0
loc 25
rs 10
c 0
b 0
f 0
ccs 8
cts 8
cp 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 4 1
A register() 0 11 1
1
<?php
2
3
namespace lroman242\LaravelCassandra;
4
5
use Illuminate\Support\ServiceProvider;
6
7
class CassandraServiceProvider extends ServiceProvider
8
{
9
    /**
10
     * Bootstrap the application events.
11
     */
12 49
    public function boot()
13
    {
14
15 49
    }
16
17
    /**
18
     * Register the service provider.
19
     */
20
    public function register()
21
    {
22
        // Add database driver.
23
        $this->app->resolving('db', function ($db) {
24 49
            $db->extend('cassandra', function ($config, $name) {
25 49
                $config['name'] = $name;
26
27 49
                return new Connection((new CassandraConnector)->connect($config), $config);
28 49
            });
29 49
        });
30 49
    }
31
}
32