GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

EmailCheckerServiceProvider::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
/*
4
 * This file is part of the EmailChecker package.
5
 *
6
 * (c) Matthieu Moquet <[email protected]>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace EmailChecker\Laravel;
13
14
use EmailChecker\EmailChecker;
15
use Illuminate\Support\ServiceProvider;
16
use Validator;
17
18
/**
19
 * Laravel service provider.
20
 *
21
 * @author Oliver Green <[email protected]>
22
 */
23
class EmailCheckerServiceProvider extends ServiceProvider
24
{
25
    /**
26
     * Register the factory in the application container.
27
     */
28
    public function register()
29
    {
30
        /*
31
         * Register the e-mail checker
32
         */
33
        $this->app->singleton(EmailChecker::class, function ($app) {
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed.

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

Loading history...
34
            return new EmailChecker();
35
        });
36
37
        /*
38
         * Alias the dependency for ease.
39
         */
40
        $this->app->alias(EmailChecker::class, 'email.checker');
41
    }
42
43
    /**
44
     * Bootstrap any application services.
45
     */
46
    public function boot(EmailChecker $checker)
47
    {
48
        /*
49
         * Add a custom validator filter.
50
         */
51
        $check = function ($attr, $value, $param, $validator) use ($checker) {
0 ignored issues
show
Unused Code introduced by
The parameter $param is not used and could be removed.

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

Loading history...
Unused Code introduced by
The parameter $validator is not used and could be removed.

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

Loading history...
52
            return $checker->isValid($value);
53
        };
54
55
        Validator::extend(
56
            'not_throw_away', $check, 'The :attribute domain is invalid.'
57
        );
58
    }
59
60
    /**
61
     * Get the services provided by the provider.
62
     *
63
     * @return array
64
     */
65
    public function provides()
66
    {
67
        return ['email.checker', EmailChecker::class];
68
    }
69
}
70