Completed
Push — master ( 032fc4...769083 )
by Elf
05:36
created

OptimusServiceProvider::provides()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
ccs 0
cts 0
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace App\Providers;
4
5
use Illuminate\Support\ServiceProvider;
6
use Jenssegers\Optimus\Optimus;
7
8
class OptimusServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * Indicates if loading of the provider is deferred.
12
     *
13
     * @var bool
14
     */
15
    protected $defer = true;
16
17
    /**
18
     * Register the service provider.
19
     */
20
    public function register()
21
    {
22 1
        $this->app->singleton(Optimus::class, function ($app) {
23
            $config = $app['config']['optimus'];
24
25
            return new Optimus($config['prime'], $config['inverse'], $config['random']);
26 1
        });
27
28 1
        $this->app->alias(Optimus::class, 'optimus');
29 1
    }
30
31
    /**
32
     * Get the services provided by the provider.
33
     *
34
     * @return array
35
     */
36
    public function provides()
37
    {
38
        return [Optimus::class, 'optimus'];
39
    }
40
}
41