Passed
Push — master ( bf511f...1161b4 )
by Mehmet
01:26
created

TrTaxNumberRule::passes()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 2
1
<?php
2
3
namespace XLaravel\ValidationTrTaxNumberExtend\Rules;
4
5
use Illuminate\Contracts\Validation\Rule;
6
use XAdam\TrTaxNumberValidation;
7
8
class TrTaxNumberRule implements Rule
9
{
10
    public function passes($attribute, $value): bool
11
    {
12
        return TrTaxNumberValidation::validate($value);
13
    }
14
15
    public function message(): string
16
    {
17
        return trans('X-Laravel::validationTrTaxNumberExtend.error');
0 ignored issues
show
Bug introduced by
The function trans was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

17
        return /** @scrutinizer ignore-call */ trans('X-Laravel::validationTrTaxNumberExtend.error');
Loading history...
18
    }
19
}
20