-
Notifications
You must be signed in to change notification settings - Fork 2
Country
Pieter Hordijk edited this page Dec 30, 2018
·
1 revision
Validates the input (string
) to be a valid ISO alpha 2 country code.
Available since: 1.0.0
<?php declare(strict_types);
use HarmonyIO\Validation\Rule\Country\Alpha2Code;
(new Alpha2Code())->validate('NL');
-
Type.String
when the validated value is not a string -
Country.Alpha2Code
when the validated value is not a valid alpha 2 country code
Validates the input (string
) to be a valid ISO alpha 3 country code.
Available since: 1.0.0
<?php declare(strict_types);
use HarmonyIO\Validation\Rule\Country\Alpha3Code;
(new Alpha3Code())->validate('NLD');
-
Type.String
when the validated value is not a string -
Country.Alpha3Code
when the validated value is not a valid alpha 3 country code
Validates the input (string
) to be a valid ISO numeric country code.
Available since: 1.0.0
<?php declare(strict_types);
use HarmonyIO\Validation\Rule\Country\NumericCode;
(new NumericCode())->validate('894');
-
Type.String
when the validated value is not a string -
Country.NumericCode
when the validated value is not a valid numeric country code