UploadFile.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. namespace EasySwoole\Validate\tests;
  3. use Psr\Http\Message\UploadedFileInterface;
  4. class UploadFile implements UploadedFileInterface
  5. {
  6. private $tempName;
  7. private $stream;
  8. private $size;
  9. private $error;
  10. private $clientFileName;
  11. private $clientMediaType;
  12. public function __construct($tempName, $size, $errorStatus, $clientFilename = null, $clientMediaType = null)
  13. {
  14. $this->tempName = $tempName;
  15. $this->stream = '';
  16. $this->error = $errorStatus;
  17. $this->size = $size;
  18. $this->clientFileName = $clientFilename;
  19. $this->clientMediaType = $clientMediaType;
  20. }
  21. public function getTempName()
  22. {
  23. return $this->tempName;
  24. }
  25. public function getStream()
  26. {
  27. return $this->stream;
  28. }
  29. public function moveTo($targetPath)
  30. {
  31. }
  32. public function getSize()
  33. {
  34. return $this->size;
  35. }
  36. public function getError()
  37. {
  38. return $this->error;
  39. }
  40. public function getClientFilename()
  41. {
  42. return $this->clientFileName;
  43. }
  44. public function getClientMediaType()
  45. {
  46. return $this->clientMediaType;
  47. }
  48. }