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.
Completed
Push — master ( 48a745...68b305 )
by Yunus Emre
05:44
created

TCKimlikNoValidate::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
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 4
dl 0
loc 10
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
    public function __construct(
23
        string $name,
24
        string $surname,
25
        string $birthYear,
26
        bool $autoUppercase = true
27
    ){
28
        $this->name = $name;
29
        $this->surname = $surname;
30
        $this->birthYear = $birthYear;
31
        $this->autoUppercase = $autoUppercase;
32
    }
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
    public function passes($attribute, $value)
43
    {
44
        return TCKimlikNo::validate(
45
            $value,
46
            $this->name,
47
            $this->surname,
48
            $this->birthYear,
49
            $this->autoUppercase
50
        );
51
    }
52
53
    /**
54
     * Get the validation error message.
55
     *
56
     * @return string
57
     */
58
    public function message()
59
    {
60
        return 'The :attribute must be a real Turkish Citizen Number.';
61
    }
62
}