AppServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 23
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 2 1
A boot() 0 6 1
1
<?php
2
3
namespace Soved\Laravel\Validation\PhoneNumber;
4
5
use Illuminate\Support\ServiceProvider;
6
use Illuminate\Support\Facades\Validator;
7
8
class AppServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * Bootstrap any application services.
12
     *
13
     * @return void
14
     */
15
    public function boot()
16
    {
17
        Validator::extend(
18
            'phone_number',
19
            new Rules\PhoneNumber,
0 ignored issues
show
Bug introduced by
new Soved\Laravel\Valida...ber\Rules\PhoneNumber() of type Soved\Laravel\Validation...umber\Rules\PhoneNumber is incompatible with the type Closure|string expected by parameter $extension of Illuminate\Support\Facades\Validator::extend(). ( Ignorable by Annotation )

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

19
            /** @scrutinizer ignore-type */ new Rules\PhoneNumber,
Loading history...
20
            'The :attribute format is invalid.'
21
        );
22
    }
23
24
    /**
25
     * Register the service provider.
26
     *
27
     * @return void
28
     */
29
    public function register()
30
    {
31
        //
32
    }
33
}
34