purpledot/validation-bundle
最新稳定版本:1.0.1
Composer 安装命令:
composer require purpledot/validation-bundle
包简介
.
关键字:
README 文档
README
Additional validators set for Symfony.
Installation
From the command line run
$ composer require purpledot/validation-bundle
Validators
PolishIdCardNumber
Checks if the value is a valid Polish ID number.
Example usage
use PurpleDot\ValidationBundle\Validator\Constraints as PurpleDotAssert; // ... #[PurpleDotAssert\PolishIdCardNumber] private ?string $idCardNUmber = null;
PolishMobilePhone
Checks if the value is a valid Polish mobile phone number.
Example usage
use PurpleDot\ValidationBundle\Validator\Constraints as PurpleDotAssert; // ... #[PurpleDotAssert\PolishMobilePhone] private ?string $phoneNumber;
PolishTaxNumber
Checks if the value is a valid Polish tax number (NIP).
| Parameter | Type | Default | Description |
|---|---|---|---|
| requirePrefix | bool | false | Enable/disable tax number prefix requirement |
| allowPrefix | bool | true | Enable/Disable ability to provide a tax number prefix |
Example usage
use PurpleDot\ValidationBundle\Validator\Constraints as PurpleDotAssert; // ... #[PurpleDotAssert\PolishTaxNumber] private ?string $taxNumber; $this->taxNumber = 'PL7746249830' // valid $this->taxNumber = '7746249830' // valid
Require tax number prefix
use PurpleDot\ValidationBundle\Validator\Constraints as PurpleDotAssert; // ... #[PurpleDotAssert\PolishTaxNumber(requirePrefix: true)] private ?string $taxNumber; $this->taxNumber = 'PL7746249830' // valid $this->taxNumber = '7746249830' // invalid
Disallow tax number prefix
use PurpleDot\ValidationBundle\Validator\Constraints as PurpleDotAssert; // ... #[PurpleDotAssert\PolishTaxNumber(allowPrefix: false)] private ?string $taxNumber; $this->taxNumber = '7746249830' // valid $this->taxNumber = 'PL7746249830' // invalid
Pesel
Checks if the value is a valid PESEL number.
Example usage
use PurpleDot\ValidationBundle\Validator\Constraints as PurpleDotAssert; // ... #[PurpleDotAssert\Pesel] private ?string $pesel = null;
统计信息
- 总下载量: 79
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-02-01