src/Core/Validator/Constraints/Valid.php line 27

  1. <?php
  2. declare(strict_types=1);
  3. /**
  4.  * Copyright (c) 2022 TECLA Consulting Group oü.
  5.  * All rights reserved.
  6.  *
  7.  * This unpublished material is proprietary to TECLA Consulting Group oü.
  8.  * All rights reserved. The methods and
  9.  * techniques described herein are considered trade secrets
  10.  * and/or confidential. Reproduction or distribution, in whole
  11.  * or in part, is forbidden except by express written permission
  12.  * of TECLA Consulting Group oü.
  13.  *
  14.  * @author    Matúš Sýkorjak <matus@tecla.no>
  15.  * @copyright 2022 TECLA Consulting Group oü
  16.  */
  17. namespace App\Core\Validator\Constraints;
  18. use Symfony\Component\Validator\Constraint;
  19. final class Valid extends Constraint
  20. {
  21.     public array $validationGroups = [];
  22.     public function __construct(
  23.         array $options null,
  24.         ?array $groups null,
  25.         mixed $payload null,
  26.         ?array $validationGroups null
  27.     ) {
  28.         parent::__construct($options ?? [], $groups$payload);
  29.         $this->validationGroups $validationGroups ?? $this->validationGroups;
  30.     }
  31.     public function getTargets(): array|string
  32.     {
  33.         return [self::CLASS_CONSTRAINTself::PROPERTY_CONSTRAINT];
  34.     }
  35. }