CassandraServiceProvider   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 5
Bugs 1 Features 1
Metric Value
wmc 1
c 5
b 1
f 1
lcom 1
cbo 3
dl 0
loc 24
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 13 1
1
<?php
2
3
namespace Websmurf\LaravelCassandra;
4
5
use Illuminate\Support\ServiceProvider;
6
7
class CassandraServiceProvider extends ServiceProvider
8
{
9
    /** @inheritdoc */
10
    protected $defer = true;
11
12
    /**
13
     * Register the service provider.
14
     *
15
     * @return void
16
     */
17
    public function register()
18
    {
19
        // Attempt to load default configuration
20
        $this->mergeConfigFrom(__DIR__ . '/../config/cassandra.php', 'cassandra');
21
22
        // Configure cassandra options
23
        $this->app->configure('cassandra');
24
25
        // Register cassandra
26
        $this->app->singleton('Cassandra', function () {
27
            return new Cassandra();
28
        });
29
    }
30
}