Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marcw/validator
Symfony Validators for: Subdomain validation, Username, GA Tracker ID, SMS Message, HTML Color,
https://github.com/marcw/validator
php sms-messages symfony symfony-validator username validator
Last synced: 19 days ago
JSON representation
Symfony Validators for: Subdomain validation, Username, GA Tracker ID, SMS Message, HTML Color,
- Host: GitHub
- URL: https://github.com/marcw/validator
- Owner: marcw
- License: mit
- Created: 2016-09-07T08:51:32.000Z (about 8 years ago)
- Default Branch: main
- Last Pushed: 2023-04-22T09:58:43.000Z (over 1 year ago)
- Last Synced: 2024-10-11T13:12:14.094Z (about 1 month ago)
- Topics: php, sms-messages, symfony, symfony-validator, username, validator
- Language: PHP
- Homepage:
- Size: 23.4 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Validator
[![Build Status](https://travis-ci.org/marcw/validator.svg?branch=master)](https://travis-ci.org/marcw/validator)
[![Coverage Status](https://coveralls.io/repos/github/marcw/validator/badge.svg?branch=master)](https://coveralls.io/github/marcw/validator?branch=master)
[![SensioLabsInsight](https://insight.sensiolabs.com/projects/75cf3a3f-a16d-4f05-a3e8-46b190b4daf5/mini.png)](https://insight.sensiolabs.com/projects/75cf3a3f-a16d-4f05-a3e8-46b190b4daf5)Some additions to the [Validator Symfony Component](github.com/symfony/symfony).
## Subdomain validation
Validate a string value based on these rules:
- Be not null.
- Be not blank.
- Be more than or equal to 3 characters.
- Be less than 63 characters.
- Be in alphanumeric and hyphen.
- Do not start with an hyphen.
- Do not end with an hyphen.## Username validation
Validate a string value based on [The Big Username
Blocklist](https://github.com/marteinn/The-Big-Username-Blocklist). It won't
validate if the value is equal to one of these terms.## GoogleAnalytics Tracker ID validation
Validate that a string matches the correct format for a Google Analytics Tracker ID.
## SMS Message Validation.
Validate that a value fits in one (or more) SMS message.
## HTMLColor validator
Validate that a string matches the basic HTML format for a color (`#abc` or `#abcdef`)
## Example
```php