rocketfellows / country-vat-format-validator-interface
v1.1.0
2023-04-01 17:36 UTC
Requires
- php: >=7.4
- rocketfellows/tuple: ^1.0
Requires (Dev)
- phpstan/phpstan: ^0.12.90
- phpunit/phpunit: ^8.5
- squizlabs/php_codesniffer: 3.6.2
This package is not auto-updated.
Last update: 2024-09-29 00:21:59 UTC
README
该组件为不同国家的vat格式验证器实现提供接口。
包括
- CountryVatFormatValidatorInterface - 国家vat格式验证器的主要接口。
- CountryVatFormatValidator - 抽象国家vat格式验证器,强制执行接口契约的类。
- CountryVatFormatEmptinessValidator - 简单国家vat格式验证器,CountryVatFormatValidatorInterface实现的示例,也提供仅空验证,如果由于某些原因某些国家的格式不是必需的。
- CountryVatFormatValidators - CountryVatFormatValidatorInterface元组实现。
安装
composer require rocketfellows/country-vat-format-validator-interface
CountryVatFormatValidatorInterface描述
CountryVatFormatValidatorInterface有一个函数 isValid,它接受字符串vat号码作为参数。接口实现必须处理内部异常并抛出异常
- CountryVatFormatValidationException
CountryVatFormatValidator描述
CountryVatFormatValidator强制执行CountryVatFormatValidatorInterface契约,处理所有异常并抛出CountryVatFormatValidationException。继承者必须实现抽象函数 isValidFormat,其中必须编写所有验证。
继承者示例:CountryVatFormatEmptinessValidator
CountryVatFormatEmptinessValidator描述
CountryVatFormatEmptinessValidator简单国家vat格式验证器,CountryVatFormatValidatorInterface实现的示例。也提供仅空验证,如果由于某些原因某些国家的格式不是必需的。
可以作为其他国家vat格式验证器实现示例。
CountryVatFormatValidators描述
CountryVatFormatValidators - CountryVatFormatValidatorInterface元组实现。表示CountryVatFormatValidatorInterface类型对象的不可变元组。
贡献
欢迎提交拉取请求。如果有重大更改,请首先创建一个问题以进行讨论。
请确保适当更新测试。