fileinfo.stub.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. /** @generate-class-entries */
  3. /** @not-serializable */
  4. class finfo
  5. {
  6. /** @alias finfo_open */
  7. public function __construct(int $flags = FILEINFO_NONE, ?string $magic_database = null) {}
  8. /**
  9. * @param resource|null $context
  10. * @tentative-return-type
  11. * @alias finfo_file
  12. */
  13. public function file(string $filename, int $flags = FILEINFO_NONE, $context = null): string|false {}
  14. /**
  15. * @param resource|null $context
  16. * @tentative-return-type
  17. * @alias finfo_buffer
  18. */
  19. public function buffer(string $string, int $flags = FILEINFO_NONE, $context = null): string|false {}
  20. /**
  21. * @return bool
  22. * @alias finfo_set_flags
  23. */
  24. public function set_flags(int $flags) {} // TODO make return type void
  25. }
  26. /** @refcount 1 */
  27. function finfo_open(int $flags = FILEINFO_NONE, ?string $magic_database = null): finfo|false {}
  28. function finfo_close(finfo $finfo): bool {}
  29. function finfo_set_flags(finfo $finfo, int $flags): bool {} // TODO make return type void
  30. /**
  31. * @param resource|null $context
  32. * @refcount 1
  33. */
  34. function finfo_file(finfo $finfo, string $filename, int $flags = FILEINFO_NONE, $context = null): string|false {}
  35. /**
  36. * @param resource|null $context
  37. * @refcount 1
  38. */
  39. function finfo_buffer(finfo $finfo, string $string, int $flags = FILEINFO_NONE, $context = null): string|false {}
  40. /**
  41. * @param resource|string $filename
  42. * @refcount 1
  43. */
  44. function mime_content_type($filename): string|false {}