ValidatorInterface.php 739 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. declare(strict_types=1);
  7. namespace Magento\Framework\App\Request;
  8. use Magento\Framework\App\ActionInterface;
  9. use Magento\Framework\App\RequestInterface;
  10. /**
  11. * Validate interface before giving passing it to an ActionInterface.
  12. */
  13. interface ValidatorInterface
  14. {
  15. /**
  16. * Validate request and throw the exception if it's invalid.
  17. *
  18. * @param RequestInterface $request
  19. * @param ActionInterface $action
  20. * @throws InvalidRequestException If request was invalid.
  21. *
  22. * @return void
  23. */
  24. public function validate(
  25. RequestInterface $request,
  26. ActionInterface $action
  27. ): void;
  28. }