for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace FlexPHP\Schema\Validators\Constraints;
use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Component\Validator\Constraints\Positive;
use Symfony\Component\Validator\ConstraintViolationListInterface;
use Symfony\Component\Validator\Validation;
/**
* @Annotation
*/
class MaxConstraintValidator
{
* @param mixed $max
* @return ConstraintViolationListInterface
public function validate($max): ConstraintViolationListInterface
$validator = Validation::createValidator();
return $validator->validate($max, [
new NotBlank(),
new Positive(),
]);
}