CassandraServiceProvider::register()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 5
Bugs 1 Features 1
Metric Value
c 5
b 1
f 1
dl 0
loc 13
rs 9.4285
cc 1
eloc 5
nc 1
nop 0
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
}