godruoyi /
laravel-idcard-validator
| 1 | <?php |
||||||||||
| 2 | |||||||||||
| 3 | /* |
||||||||||
| 4 | * This file is part of the godruoyi/laravel-idcard-validator. |
||||||||||
| 5 | * |
||||||||||
| 6 | * (c) Godruoyi <[email protected]> |
||||||||||
| 7 | * |
||||||||||
| 8 | * This source file is subject to the MIT license that is bundled. |
||||||||||
| 9 | */ |
||||||||||
| 10 | |||||||||||
| 11 | namespace Godruoyi\LaravelIdCard; |
||||||||||
| 12 | |||||||||||
| 13 | use Illuminate\Support\Facades\Validator; |
||||||||||
| 14 | use Illuminate\Support\ServiceProvider as BaseServiceProvider; |
||||||||||
| 15 | |||||||||||
| 16 | class ServiceProvider extends BaseServiceProvider |
||||||||||
| 17 | { |
||||||||||
| 18 | /** |
||||||||||
| 19 | * Bootstrap any application services. |
||||||||||
| 20 | */ |
||||||||||
| 21 | 2 | public function boot() |
|||||||||
| 22 | { |
||||||||||
| 23 | Validator::extend('idcard', function ($attribute, $value, $parameters, $validator) { |
||||||||||
|
0 ignored issues
–
show
The parameter
$validator 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
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...
|
|||||||||||
| 24 | 1 | return IdCard::passes($value); |
|||||||||
| 25 | 2 | }); |
|||||||||
| 26 | |||||||||||
| 27 | Validator::replacer('idcard', function ($message, $attribute, $rule, $parameters) { |
||||||||||
|
0 ignored issues
–
show
The parameter
$attribute 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
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...
The parameter
$message 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
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...
The parameter
$rule 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
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...
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
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 | 1 | return '无效的身份证号码'; |
|||||||||
| 29 | 2 | }); |
|||||||||
| 30 | 2 | } |
|||||||||
| 31 | } |
||||||||||
| 32 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.