Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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,

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