You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possibile to check if only a part of the codice fiscale is valid?
For example, only the name - surname part and/or the lettera di controllo part?
Thank you!
The text was updated successfully, but these errors were encountered:
Hi @Polm90. Unfortunately, it's not possible to partially check a codice fiscale with this package. If you are interested in the project, feel free to submit a PR for it.👍
@Polm90 I set up the Subject with name and surname and fills the rest with fictional values. Then checking 6 characters of calculated value with user input:
$calculator = new Calculator(
new Subject(
[
'name' => $name,
'surname' => $surname,
// fake data to make calculator work
'birthDate' => new \DateTimeImmutable('1980-01-01'),
'gender' => 'M',
'belfioreCode' => 'D641', // Fobello (VC)
]),
['omocodiaAllowed' => true]
);
$calculated = $calculator->calculate();
// compare first 6 characters only
return substr($cf, 0, 6) === substr($calculated, 0, 6);
Is it possibile to check if only a part of the codice fiscale is valid?
For example, only the name - surname part and/or the lettera di controllo part?
Thank you!
The text was updated successfully, but these errors were encountered: