Skip to content

Commit

Permalink
Merge pull request #29 from minvws/update-readme
Browse files Browse the repository at this point in the history
Updated readme
  • Loading branch information
ricklambrechts authored Mar 8, 2023
2 parents 2b0671f + 6cc8deb commit 1580b28
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,28 +73,30 @@ var_dump($user->toArray());

```text
array(9) {
'givenName' =>
'agb_code' =>
string(8) "00000000"
'card_type' =>
string(1) "N"
'given_name' =>
string(4) "john"
'surName' =>
string(12) "doe-11111111"
'OidCa' =>
'oid_ca' =>
string(25) "2.16.528.1.1003.1.3.5.5.2"
'UziVersion' =>
'role' =>
string(6) "01.015"
'subscriber_number' =>
string(6) "90000111"
'sur_name' =>
string(12) "doe-11111111"
'uzi_number' =>
string(8) "11111111"
'uzi_version' =>
string(1) "1"
'UziNumber' =>
'serial_number' =>
string(8) "11111111"
'CardType' =>
string(1) "N"
'SubscriberNumber' =>
string(8) "90000111"
'Role' =>
string(6) "01.015"
'AgbCode' =>
string(8) "00000000"
}
```

This package also allows validation of the returned user:
This package also allows validation of the request:

```php
$allowedTypes = [
Expand All @@ -106,8 +108,8 @@ $allowedRoles = [
UziConstants::UZI_ROLE_PHARMACIST,
];

$validator = new UziValidator(true, $allowedTypes, $allowedRoles);
if ($validator->isValid($user)) {
$validator = new UziValidator(new UziReader(), true, $allowedTypes, $allowedRoles);
if ($validator->isValid($request)) {
print "Validated as doctor or pharmasist";
}
```
Expand Down

0 comments on commit 1580b28

Please sign in to comment.