respect-validation/library/Transformers/Transformer.php
Henrique Moody 1e2c1bfe30
Create transformers for deprecated rules
For now, those transformers will help transition from the current major
version to the next. As I'm making so many changes to the behaviour of
the rules and renaming others, it could be overwhelming to update all of
them suddenly.

The Transformers will change the rules' specifications before the
Factory creates them, allowing us to keep the behaviour of the old rules
-- even if a little bit different -- while triggering E_USER_DEPRECATED
errors to indicate that the client needs to update their code until the
next major version.

However, those transformers will do more shortly, for example, allowing
us to prefix rules to make it easier to create complex rules, like
`notPositive()` or even `keyBetween('foo', 1, 10)` and so on.

Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2024-03-08 22:03:43 +01:00

15 lines
266 B
PHP

<?php
/*
* Copyright (c) Alexandre Gomes Gaigalas <alganet@gmail.com>
* SPDX-License-Identifier: MIT
*/
declare(strict_types=1);
namespace Respect\Validation\Transformers;
interface Transformer
{
public function transform(RuleSpec $ruleSpec): RuleSpec;
}