Completed
Push — master ( 7d5774...4fb208 )
by Milroy
66:10
created

ObfuscateServiceProvider::boot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 5
ccs 4
cts 4
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace ApiChef\Obfuscate;
4
5
use Illuminate\Support\ServiceProvider;
6
use Jenssegers\Optimus\Optimus;
7
8
class ObfuscateServiceProvider extends ServiceProvider
9
{
10 22
    public function boot()
11
    {
12 22
        $this->publishes([
13 22
            __DIR__.'/../config/obfuscate.php' => config_path('obfuscate.php'),
14 22
        ], 'config');
15 22
    }
16
17 22
    public function register()
18
    {
19 22
        $this->mergeConfigFrom(
20 22
            __DIR__.'/../config/obfuscate.php',
21 22
            'obfuscate'
22
        );
23
24
        $this->app->singleton(Optimus::class, function ($app) {
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

24
        $this->app->singleton(Optimus::class, function (/** @scrutinizer ignore-unused */ $app) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
25 22
            return new Optimus(
26 22
                config('obfuscate.prime'),
27 22
                config('obfuscate.inverse'),
28 22
                config('obfuscate.xor')
29
            );
30 22
        });
31
32
        $this->app->bind('obfuscate', function ($app) {
33 8
            return $app->make(Obfuscate::class);
34 22
        });
35 22
    }
36
}
37