AppServiceProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 6
rs 10
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