GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

TCKimlikNoValidate::message()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
1
<?php
2
3
namespace Deligoez\TCKimlikNo\Rules;
4
5
use Deligoez\TCKimlikNo\TCKimlikNo;
6
use Illuminate\Contracts\Validation\Rule;
7
8
class TCKimlikNoValidate implements Rule
9
{
10
    /** @var string */
11
    protected $name;
12
13
    /** @var string */
14
    protected $surname;
15
16
    /** @var string */
17
    protected $birthYear;
18
19
    /** @var bool */
20
    protected $autoUppercase;
21
22 1
    public function __construct(
23
        string $name,
24
        string $surname,
25
        string $birthYear,
26
        bool $autoUppercase = true
27
    ) {
28 1
        $this->name = $name;
29 1
        $this->surname = $surname;
30 1
        $this->birthYear = $birthYear;
31 1
        $this->autoUppercase = $autoUppercase;
32 1
    }
33
34
    /**
35
     * Determine if the validation rule passes.
36
     *
37
     * @param  string  $attribute
38
     * @param  mixed  $value
39
     * @return bool
40
     * @throws \SoapFault
41
     */
42 1
    public function passes($attribute, $value): bool
43
    {
44 1
        return TCKimlikNo::validate(
45 1
            $value,
46 1
            $this->name,
47 1
            $this->surname,
48 1
            $this->birthYear,
49 1
            $this->autoUppercase
50
        );
51
    }
52
53
    /**
54
     * Get the validation error message.
55
     *
56
     * @return string
57
     */
58
    public function message(): string
59
    {
60
        return 'The :attribute must be a real Turkish Citizen Number.';
61
    }
62
}
63