You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
1.1 KiB

3 years ago
  1. <?php
  2. namespace Psr\Http\Message;
  3. interface UploadedFileFactoryInterface
  4. {
  5. /**
  6. * Create a new uploaded file.
  7. *
  8. * If a size is not provided it will be determined by checking the size of
  9. * the file.
  10. *
  11. * @see http://php.net/manual/features.file-upload.post-method.php
  12. * @see http://php.net/manual/features.file-upload.errors.php
  13. *
  14. * @param StreamInterface $stream Underlying stream representing the
  15. * uploaded file content.
  16. * @param int $size in bytes
  17. * @param int $error PHP file upload error
  18. * @param string $clientFilename Filename as provided by the client, if any.
  19. * @param string $clientMediaType Media type as provided by the client, if any.
  20. *
  21. * @return UploadedFileInterface
  22. *
  23. * @throws \InvalidArgumentException If the file resource is not readable.
  24. */
  25. public function createUploadedFile(
  26. StreamInterface $stream,
  27. int $size = null,
  28. int $error = \UPLOAD_ERR_OK,
  29. string $clientFilename = null,
  30. string $clientMediaType = null
  31. ): UploadedFileInterface;
  32. }