emanueleminotto/reserved-usernames-validator

Symfony validator for reserved usernames

1.0.0 2016-12-24 16:37 UTC

This package is auto-updated.

Last update: 2024-10-28 07:20:28 UTC


README

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

Symfony validator for reserved usernames (or strings), based on shouldbee/reserved-usernames.

Install

Via Composer

$ composer require emanueleminotto/reserved-usernames-validator

Usage

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.

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CONDUCT for details.

Security

If you discover any security related issues, please email minottoemanuele@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.