PathValidatorInterface.php 792 B

1234567891011121314151617181920212223242526272829303132333435
  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\Filesystem\Directory;
  8. use Magento\Framework\Exception\ValidatorException;
  9. /**
  10. * Validate paths to be used with directories.
  11. */
  12. interface PathValidatorInterface
  13. {
  14. /**
  15. * Validate if path can be used with a directory.
  16. *
  17. * @param string $directoryPath
  18. * @param string $path
  19. * @param string|null $scheme
  20. * @param bool $absolutePath Is given path an absolute path?.
  21. * @throws ValidatorException
  22. *
  23. * @return void
  24. */
  25. public function validate(
  26. string $directoryPath,
  27. string $path,
  28. ?string $scheme = null,
  29. bool $absolutePath = false
  30. ): void;
  31. }