EmailValidatorServiceProvider::provides()   A
last analyzed

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 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Unicodeveloper\EmailValidator;
4
5
use Illuminate\Support\ServiceProvider;
6
use Unicodeveloper\EmailValidator\EmailValidator;
7
8
class EmailValidatorServiceProvider extends ServiceProvider
9
{
10
11
    /**
12
     * Indicates if loading of the provider is deferred.
13
     *
14
     * @var bool
15
     */
16
    protected $defer = false;
17
18
    /**
19
     * Publishes all the config file this package needs to function
20
     * @return void
21
     */
22
    public function boot()
23
    {
24
        $config = realpath(__DIR__.'/../resources/config/emailValidator.php');
25
26
        $this->publishes([
27
            $config => config_path('emailValidator.php')
28
        ]);
29
    }
30
31
    /**
32
     * Register the application services
33
     * @return void
34
     */
35
    public function register()
36
    {
37
        $this->app->bind('laravel-email-validator', function(){
38
39
            return new EmailValidator;
40
41
        });
42
    }
43
44
    /**
45
     * Get the services provided by the provider
46
     * @return array
47
     */
48
    public function provides()
49
    {
50
        return ['laravel-email-validator'];
51
    }
52
}