MutableServiceProvider::provides()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Sofa\Eloquence;
4
5
use Sofa\Eloquence\Mutator\Mutator;
6
use Illuminate\Support\ServiceProvider as BaseProvider;
7
8
/**
9
 * @codeCoverageIgnore
10
 */
11
class MutableServiceProvider extends BaseProvider
12
{
13
14
    /**
15
     * Register the service provider.
16
     *
17
     * @return void
18
     */
19
    public function register()
20
    {
21
        $this->registerMutator();
22
    }
23
24
    /**
25
     * Register attribute mutator service.
26
     *
27
     * @return void
28
     */
29
    protected function registerMutator()
30
    {
31
        $this->app->singleton('eloquence.mutator', function () {
32
            return new Mutator;
33
        });
34
35
        $this->app->alias('eloquence.mutator', 'Sofa\Eloquence\Contracts\Mutator');
36
    }
37
38
    /**
39
     * Get the services provided by the provider.
40
     *
41
     * @return array
42
     */
43
    public function provides()
44
    {
45
        return ['eloquence.mutator'];
46
    }
47
}
48