FilesystemWriter.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. declare(strict_types=1);
  3. namespace League\Flysystem;
  4. interface FilesystemWriter
  5. {
  6. /**
  7. * @throws UnableToWriteFile
  8. * @throws FilesystemException
  9. */
  10. public function write(string $location, string $contents, array $config = []): void;
  11. /**
  12. * @param mixed $contents
  13. *
  14. * @throws UnableToWriteFile
  15. * @throws FilesystemException
  16. */
  17. public function writeStream(string $location, $contents, array $config = []): void;
  18. /**
  19. * @throws UnableToSetVisibility
  20. * @throws FilesystemException
  21. */
  22. public function setVisibility(string $path, string $visibility): void;
  23. /**
  24. * @throws UnableToDeleteFile
  25. * @throws FilesystemException
  26. */
  27. public function delete(string $location): void;
  28. /**
  29. * @throws UnableToDeleteDirectory
  30. * @throws FilesystemException
  31. */
  32. public function deleteDirectory(string $location): void;
  33. /**
  34. * @throws UnableToCreateDirectory
  35. * @throws FilesystemException
  36. */
  37. public function createDirectory(string $location, array $config = []): void;
  38. /**
  39. * @throws UnableToMoveFile
  40. * @throws FilesystemException
  41. */
  42. public function move(string $source, string $destination, array $config = []): void;
  43. /**
  44. * @throws UnableToCopyFile
  45. * @throws FilesystemException
  46. */
  47. public function copy(string $source, string $destination, array $config = []): void;
  48. }