TrTaxNumberRule   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A message() 0 3 1
A passes() 0 3 1
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