1 | <?php |
||||||
2 | |||||||
3 | namespace XAdam; |
||||||
4 | |||||||
5 | class TrCitizenNumberVerification |
||||||
6 | { |
||||||
7 | public const API_URL = 'https://tckimlik.nvi.gov.tr/Service/KPSPublic.asmx?WSDL'; |
||||||
8 | private static ?object $client = null; |
||||||
9 | |||||||
10 | public static function verify(int $citizen_number, int $birth_year, string $name, string $surname): bool |
||||||
11 | { |
||||||
12 | if (!TrCitizenNumberValidation::validate($citizen_number)) { |
||||||
13 | return false; |
||||||
14 | } |
||||||
15 | |||||||
16 | if ($birth_year < 1900 || $birth_year > date('Y')) { |
||||||
17 | return false; |
||||||
18 | } |
||||||
19 | |||||||
20 | if (static::$client === null) { |
||||||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||||||
21 | static::$client = new \SoapClient(static::API_URL); |
||||||
22 | } |
||||||
23 | |||||||
24 | $response = static::$client->TCKimlikNoDogrula([ |
||||||
0 ignored issues
–
show
The method
TCKimlikNoDogrula() does not exist on null .
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. ![]() |
|||||||
25 | 'TCKimlikNo' => $citizen_number, |
||||||
26 | 'Ad' => tr_strtoupper($name), |
||||||
27 | 'Soyad' => tr_strtoupper($surname), |
||||||
28 | 'DogumYili' => $birth_year |
||||||
29 | ]); |
||||||
30 | |||||||
31 | return $response->TCKimlikNoDogrulaResult; |
||||||
32 | } |
||||||
33 | } |
||||||
34 |