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   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Importance

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

3 Methods

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