mirror of
https://github.com/Respect/Validation.git
synced 2026-03-16 07:15:45 +01:00
This is a pattern that we already use everywhere, so it makes sense to simply turn `v` into a class alias to `Validator`, which will allow people to use all the examples in the documentation without needing to import the namespace. We already do that when we run tests, so I just changed it to be a global setting.
14 lines
238 B
PHP
14 lines
238 B
PHP
<?php
|
|
|
|
/*
|
|
* Copyright (c) Alexandre Gomes Gaigalas <alganet@gmail.com>
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
declare(strict_types=1);
|
|
|
|
use Respect\Validation\Validator;
|
|
|
|
if (!class_exists('v')) {
|
|
class_alias(Validator::class, 'v');
|
|
}
|