mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-03 16:19:26 +03:00
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),
|
||
|
];
|
||
|
}
|
||
|
}
|