emanueleminotto / reserved-usernames-validator
Symfony 验证器,用于保留用户名
1.0.0
2016-12-24 16:37 UTC
Requires
- php: ^5.6 || ^7.0
- symfony/validator: ^2.8 || ^3.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.0
- phpunit/phpunit: ^5.4.3
This package is auto-updated.
Last update: 2024-08-28 06:56:51 UTC
README
Symfony 验证器,用于保留用户名(或字符串),基于 shouldbee/reserved-usernames。
安装
通过 Composer
$ composer require emanueleminotto/reserved-usernames-validator
用法
use EmanueleMinotto\ReservedUsernamesValidator\NotReserved; $constraint = new NotReserved(); $constraint->message = 'The username "%value%" is reserved.'; // use the validator to validate the value $errorList = $this ->get('validator') ->validate('about', $constraint); $errorMessage = $errorList[0]->getMessage(); // The username "about" is reserved.
变更日志
请参阅 CHANGELOG 了解最近的变化。
测试
$ composer test
贡献
请参阅 CONTRIBUTING 和 CONDUCT 了解详情。
安全
如果您发现任何与安全相关的问题,请通过电子邮件 minottoemanuele@gmail.com 联系,而不是使用问题跟踪器。
鸣谢
许可协议
MIT 许可协议(MIT)。请参阅 许可文件 了解更多信息。