Completed
Push — user-management ( d87e21 )
by Tony
03:32
created

ValidationServiceProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 27
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 9 1
A register() 0 4 1
1
<?php
2
/**
3
 * ValidationServiceProvider.php
4
 *
5
 * -Description-
6
 *
7
 * This program is free software: you can redistribute it and/or modify
8
 * it under the terms of the GNU General Public License as published by
9
 * the Free Software Foundation, either version 3 of the License, or
10
 * (at your option) any later version.
11
 *
12
 * This program is distributed in the hope that it will be useful,
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
15
 * GNU General Public License for more details.
16
 *
17
 * You should have received a copy of the GNU General Public License
18
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
 *
20
 * @package    LibreNMS
21
 * @link       http://librenms.org
22
 * @copyright  2016 Tony Murray
23
 * @author     Tony Murray <[email protected]>
24
 */
25
26
namespace App\Providers;
27
28
29
use Illuminate\Support\ServiceProvider;
30
use Validator;
31
32
class ValidationServiceProvider extends ServiceProvider
33
{
34
    /**
35
     * Bootstrap any application services.
36
     *
37
     * @return void
38
     */
39
    public function boot()
40
    {
41
        Validator::extend('password', function($attribute, $value, $parameters, $validator) {
0 ignored issues
show
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...
42
            return auth()->validate([
0 ignored issues
show
Bug introduced by
The method validate() does not seem to exist on object<Illuminate\Contracts\Auth\Factory>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
43
                'user_id'    => $parameters[0],
44
                'password' => $value
45
            ]);
46
        });
47
    }
48
49
    /**
50
     * Register the service provider.
51
     *
52
     * @return void
53
     */
54
    public function register()
55
    {
56
        //
57
    }
58
}