respect-validation/aliases.php
Henrique Moody 7636944ea6
Register v as a class alias to Validator
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.
2025-12-27 00:08:35 +01:00

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');
}