IdentityNumberServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
eloc 7
c 3
b 0
f 0
dl 0
loc 41
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 2 1
A boot() 0 24 1
1
<?php
2
3
namespace Olssonm\IdentityNumber;
4
5
use Illuminate\Support\ServiceProvider;
6
7
class IdentityNumberServiceProvider extends ServiceProvider
8
{
9
    /**
10
     * Perform post-registration booting of services.
11
     *
12
     * @return void
13
     */
14
    public function boot()
15
    {
16
        /**
17
         * Extend the Laravel Validator with the "identity_number" rule
18
         */
19
        $this->app['validator']->extend('identity_number', function($attribute, $value, $parameters)
0 ignored issues
show
Unused Code introduced by
The parameter $parameters is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

19
        $this->app['validator']->extend('identity_number', function($attribute, $value, /** @scrutinizer ignore-unused */ $parameters)

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

Loading history...
20
        {
21
            return Pin::isValid($value, 'identity');
22
        });
23
24
        /**
25
         * Extend the Laravel Validator with the "organization_number" rule
26
         */
27
        $this->app['validator']->extend('organization_number', function($attribute, $value, $parameters)
0 ignored issues
show
Unused Code introduced by
The parameter $parameters is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

27
        $this->app['validator']->extend('organization_number', function($attribute, $value, /** @scrutinizer ignore-unused */ $parameters)

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

Loading history...
28
        {
29
            return Pin::isValid($value, 'organization');
30
        });
31
32
        /**
33
         * Extend the Laravel Validator with the "coordination_number" rule
34
         */
35
        $this->app['validator']->extend('coordination_number', function($attribute, $value, $parameters)
0 ignored issues
show
Unused Code introduced by
The parameter $parameters is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

35
        $this->app['validator']->extend('coordination_number', function($attribute, $value, /** @scrutinizer ignore-unused */ $parameters)

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

Loading history...
36
        {
37
            return Pin::isValid($value, 'coordination');
38
        });
39
    }
40
41
    /**
42
     * Register any package services.
43
     *
44
     * @return void
45
     */
46
    public function register()
47
    {
48
        //
49
    }
50
}
51