EmailValidatorServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 3
c 2
b 0
f 1
lcom 0
cbo 1
dl 0
loc 45
ccs 0
cts 17
cp 0
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 8 1
A register() 0 8 1
A provides() 0 4 1
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
}