src/Api/OpenAPI/Server/Service/ValidatorInterface.php
<?php

namespace OpenAPI\Server\Service;

use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\ConstraintViolationListInterface;

interface ValidatorInterface
{
  /**
   * Validates a value against a constraint or a list of constraints.
   *
   * If no constraint is passed, the constraint
   * {@link \Symfony\Component\Validator\Constraints\Valid} is assumed.
   *
   * @param mixed                   $value       The value to validate
   * @param Constraint|Constraint[] $constraints The constraint(s) to validate
   *                                             against
   * @param array|null              $groups      The validation groups to
   *                                             validate. If none is given,
   *                                             "Default" is assumed
   *
   * @return ConstraintViolationListInterface A list of constraint violations
   *                                          If the list is empty, validation
   *                                          succeeded
   */
  public function validate($value, $constraints = null, $groups = null);
}
