mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-03 08:09:25 +03:00
2df454c0c3
* Compound validation rule support * Compound validation rule support * Compound validation rule support * Compound validation rule support * Remove duplicated method * error during merge * wrong variable name * Simplify PR * Fix CS * Use same indentation as before Co-authored-by: Guilhem Niot <guilhem@gniot.fr> Co-authored-by: Guilhem Niot <guilhem.niot@gmail.com>
29 lines
638 B
PHP
29 lines
638 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Nelmio\ApiDocBundle\Tests\ModelDescriber\Annotations\Fixture;
|
|
|
|
use Symfony\Component\Validator\Constraints as Assert;
|
|
use Symfony\Component\Validator\Constraints\Compound;
|
|
|
|
if (!class_exists(Compound::class)) {
|
|
class_alias(CompoundStub::class, Compound::class);
|
|
}
|
|
|
|
/**
|
|
* @Annotation
|
|
*/
|
|
final class CompoundValidationRule extends Compound
|
|
{
|
|
protected function getConstraints(array $options): array
|
|
{
|
|
return [
|
|
new Assert\Type('numeric'),
|
|
new Assert\NotBlank(),
|
|
new Assert\Positive(),
|
|
new Assert\LessThan(5),
|
|
];
|
|
}
|
|
}
|