2017 © Pedro Peláez
 

library validator

Extra validators for the Symfony Validator component

image

marcw/validator

Extra validators for the Symfony Validator component

  • Thursday, February 9, 2017
  • by futurecat
  • Repository
  • 1 Watchers
  • 6 Stars
  • 152 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

Validator

Build Status Coverage Status SensioLabsInsight, (*1)

Some additions to the Validator Symfony Component., (*2)

Subdomain validation

Validate a string value based on these rules:, (*3)

  • 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. It won't validate if the value is equal to one of these terms., (*4)

GoogleAnalytics Tracker ID validation

Validate that a string matches the correct format for a Google Analytics Tracker ID., (*5)

SMS Message Validation.

Validate that a value fits in one (or more) SMS message., (*6)

HTMLColor validator

Validate that a string matches the basic HTML format for a color (#abc or #abcdef), (*7)

Example

<?php

namespace AppBundle\Entity;

use MarcW\Validator\Constraints as Assert;

class User
{
    /**
     * The username is used to attribute a subdomain or a subfolder to the user like:
     * https://username.acme.com or https://acme.com/username
     * @Assert\Subdomain
     * @Assert\Username
     */
    private $username;

    /**
     * @Assert\GoogleAnalytics
     */
    private $googleAnalytics;

    /**
     * @Assert\HTMLColor
     */
    private $backgroundColor;
}

class Message
{
    /**
     * This value must fit in 2 SMS messages.
     *
     * @Assert\SmsMessage(max=2)
     */
    private $body;
}

For more information, please read the Symfony Validator component official documentation., (*8)

Install

composer require marcw/validator

Can I contribute?

Sure! Feel free to report issues, send pull-requests, or ask for help., (*9)

LICENSE

See the LICENSE file., (*10)

The Versions

09/02 2017

dev-master

9999999-dev

Extra validators for the Symfony Validator component

  Sources   Download

MIT

The Requires

 

The Development Requires

09/02 2017

1.3.0

1.3.0.0

Extra validators for the Symfony Validator component

  Sources   Download

MIT

The Requires

 

The Development Requires

27/09 2016

1.2.0

1.2.0.0

Extra validators for the Symfony Validator component

  Sources   Download

MIT

The Requires

 

The Development Requires

27/09 2016

1.1.0

1.1.0.0

Extra validators for the Symfony Validator component

  Sources   Download

MIT

The Requires

 

The Development Requires

08/09 2016

1.0

1.0.0.0

Extra validators for the Symfony Validator component

  Sources   Download

MIT

The Requires

 

The Development Requires