mirror of
https://github.com/Respect/Validation.git
synced 2026-03-18 08:09:51 +01:00
Version 3.0 will include a few crucial deprecations. This commit adds some soft deprecations to warn users about these changes. Some of the biggest changes are: * The method `validate()` will be renamed to `isValid()`. * The method `validate()` will be repurposed to return an object with failures. * It won't be possible to handle rules directly; users will need to use the `Validator` class to validate with any rule. There will some more changes, but those are some of the most important ones, and are the ones that are easy to deprecate right now.
41 lines
937 B
Markdown
41 lines
937 B
Markdown
# SubdivisionCode
|
|
|
|
- `SubdivisionCode(string $countryCode)`
|
|
|
|
Validates subdivision country codes according to [ISO 3166-2][].
|
|
|
|
The `$countryCode` must be a country in [ISO 3166-1 alpha-2][] format.
|
|
|
|
```php
|
|
v::subdivisionCode('BR')->isValid('SP'); // true
|
|
v::subdivisionCode('US')->isValid('CA'); // true
|
|
```
|
|
|
|
This rules uses data from [iso-codes][].
|
|
|
|
## Categorization
|
|
|
|
- ISO codes
|
|
- Localization
|
|
|
|
## Changelog
|
|
|
|
Version | Description
|
|
--------|-------------
|
|
1.0.0 | Created
|
|
|
|
***
|
|
See also:
|
|
|
|
- [CountryCode](CountryCode.md)
|
|
- [CurrencyCode](CurrencyCode.md)
|
|
- [KeyValue](KeyValue.md)
|
|
- [Nip](Nip.md)
|
|
- [Pesel](Pesel.md)
|
|
- [PolishIdCard](PolishIdCard.md)
|
|
- [PublicDomainSuffix](PublicDomainSuffix.md)
|
|
- [Tld](Tld.md)
|
|
|
|
[iso-codes]: https://salsa.debian.org/iso-codes-team/iso-codes
|
|
[ISO 3166-1 alpha-2]: http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 "ISO 3166-1 alpha-2"
|
|
[ISO 3166-2]: http://en.wikipedia.org/wiki/ISO_3166-2 "ISO 3166-2"
|