spl_directory.stub.php 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  1. <?php
  2. /** @generate-class-entries */
  3. /** @not-serializable */
  4. class SplFileInfo implements Stringable
  5. {
  6. public function __construct(string $filename) {}
  7. /** @tentative-return-type */
  8. public function getPath(): string {}
  9. /** @tentative-return-type */
  10. public function getFilename(): string {}
  11. /** @tentative-return-type */
  12. public function getExtension(): string {}
  13. /** @tentative-return-type */
  14. public function getBasename(string $suffix = ""): string {}
  15. /** @tentative-return-type */
  16. public function getPathname(): string {}
  17. /** @tentative-return-type */
  18. public function getPerms(): int|false {}
  19. /** @tentative-return-type */
  20. public function getInode(): int|false {}
  21. /** @tentative-return-type */
  22. public function getSize(): int|false {}
  23. /** @tentative-return-type */
  24. public function getOwner(): int|false {}
  25. /** @tentative-return-type */
  26. public function getGroup(): int|false {}
  27. /** @tentative-return-type */
  28. public function getATime(): int|false {}
  29. /** @tentative-return-type */
  30. public function getMTime(): int|false {}
  31. /** @tentative-return-type */
  32. public function getCTime(): int|false {}
  33. /** @tentative-return-type */
  34. public function getType(): string|false {}
  35. /** @tentative-return-type */
  36. public function isWritable(): bool {}
  37. /** @tentative-return-type */
  38. public function isReadable(): bool {}
  39. /** @tentative-return-type */
  40. public function isExecutable(): bool {}
  41. /** @tentative-return-type */
  42. public function isFile(): bool {}
  43. /** @tentative-return-type */
  44. public function isDir(): bool {}
  45. /** @tentative-return-type */
  46. public function isLink(): bool {}
  47. /** @tentative-return-type */
  48. public function getLinkTarget(): string|false {}
  49. /** @tentative-return-type */
  50. public function getRealPath(): string|false {}
  51. /** @tentative-return-type */
  52. public function getFileInfo(?string $class = null): SplFileInfo {}
  53. /** @tentative-return-type */
  54. public function getPathInfo(?string $class = null): ?SplFileInfo {}
  55. /**
  56. * @param resource|null $context
  57. * @tentative-return-type
  58. */
  59. public function openFile(string $mode = "r", bool $useIncludePath = false, $context = null): SplFileObject {}
  60. /** @tentative-return-type */
  61. public function setFileClass(string $class = SplFileObject::class): void {}
  62. /** @tentative-return-type */
  63. public function setInfoClass(string $class = SplFileInfo::class): void {}
  64. /** @implementation-alias SplFileInfo::getPathname */
  65. public function __toString(): string {}
  66. /** @tentative-return-type */
  67. public function __debugInfo(): array {}
  68. /** @tentative-return-type */
  69. final public function _bad_state_ex(): void {}
  70. }
  71. class DirectoryIterator extends SplFileInfo implements SeekableIterator
  72. {
  73. public function __construct(string $directory) {}
  74. /** @tentative-return-type */
  75. public function getFilename(): string {}
  76. /** @tentative-return-type */
  77. public function getExtension(): string {}
  78. /** @tentative-return-type */
  79. public function getBasename(string $suffix = ""): string {}
  80. /** @tentative-return-type */
  81. public function isDot(): bool {}
  82. /** @tentative-return-type */
  83. public function rewind(): void {}
  84. /** @tentative-return-type */
  85. public function valid(): bool {}
  86. /**
  87. * @tentative-return-type
  88. * @return int
  89. */
  90. public function key(): mixed {} // TODO change return type to string
  91. /**
  92. * @tentative-return-type
  93. * @return DirectoryIterator
  94. */
  95. public function current(): mixed {} // TODO narrow return type
  96. /** @tentative-return-type */
  97. public function next(): void {}
  98. /** @tentative-return-type */
  99. public function seek(int $offset): void {}
  100. /** @implementation-alias DirectoryIterator::getFilename */
  101. public function __toString(): string {}
  102. }
  103. class FilesystemIterator extends DirectoryIterator
  104. {
  105. public function __construct(string $directory, int $flags = FilesystemIterator::KEY_AS_PATHNAME | FilesystemIterator::CURRENT_AS_FILEINFO | FilesystemIterator::SKIP_DOTS) {}
  106. /** @tentative-return-type */
  107. public function rewind(): void {}
  108. /** @tentative-return-type */
  109. public function key(): string {}
  110. /** @tentative-return-type */
  111. public function current(): string|SplFileInfo|FilesystemIterator {}
  112. /** @tentative-return-type */
  113. public function getFlags(): int {}
  114. /** @tentative-return-type */
  115. public function setFlags(int $flags): void {}
  116. }
  117. class RecursiveDirectoryIterator extends FilesystemIterator implements RecursiveIterator
  118. {
  119. public function __construct(string $directory, int $flags = FilesystemIterator::KEY_AS_PATHNAME | FilesystemIterator::CURRENT_AS_FILEINFO) {}
  120. /** @tentative-return-type */
  121. public function hasChildren(bool $allowLinks = false): bool {}
  122. /** @tentative-return-type */
  123. public function getChildren(): RecursiveDirectoryIterator {}
  124. /** @tentative-return-type */
  125. public function getSubPath(): string {}
  126. /** @tentative-return-type */
  127. public function getSubPathname(): string {}
  128. }
  129. #ifdef HAVE_GLOB
  130. class GlobIterator extends FilesystemIterator implements Countable
  131. {
  132. public function __construct(string $pattern, int $flags = FilesystemIterator::KEY_AS_PATHNAME | FilesystemIterator::CURRENT_AS_FILEINFO) {}
  133. /** @tentative-return-type */
  134. public function count(): int {}
  135. }
  136. #endif
  137. class SplFileObject extends SplFileInfo implements RecursiveIterator, SeekableIterator
  138. {
  139. /** @param resource|null $context */
  140. public function __construct(string $filename, string $mode = "r", bool $useIncludePath = false, $context = null) {}
  141. /** @tentative-return-type */
  142. public function rewind(): void {}
  143. /** @tentative-return-type */
  144. public function eof(): bool {}
  145. /** @tentative-return-type */
  146. public function valid(): bool {}
  147. /** @tentative-return-type */
  148. public function fgets(): string {}
  149. /** @tentative-return-type */
  150. public function fread(int $length): string|false {}
  151. /** @tentative-return-type */
  152. public function fgetcsv(string $separator = ",", string $enclosure = "\"", string $escape = "\\"): array|false {}
  153. /** @tentative-return-type */
  154. public function fputcsv(array $fields, string $separator = ",", string $enclosure = "\"", string $escape = "\\", string $eol = "\n"): int|false {}
  155. /** @tentative-return-type */
  156. public function setCsvControl(string $separator = ",", string $enclosure = "\"", string $escape = "\\"): void {}
  157. /** @tentative-return-type */
  158. public function getCsvControl(): array {}
  159. /**
  160. * @param int $wouldBlock
  161. * @tentative-return-type
  162. */
  163. public function flock(int $operation, &$wouldBlock = null): bool {}
  164. /** @tentative-return-type */
  165. public function fflush(): bool {}
  166. /** @tentative-return-type */
  167. public function ftell(): int|false {}
  168. /** @tentative-return-type */
  169. public function fseek(int $offset, int $whence = SEEK_SET): int {}
  170. /** @tentative-return-type */
  171. public function fgetc(): string|false {}
  172. /** @tentative-return-type */
  173. public function fpassthru(): int {}
  174. /** @tentative-return-type */
  175. public function fscanf(string $format, mixed &...$vars): array|int|null {}
  176. /** @tentative-return-type */
  177. public function fwrite(string $data, int $length = 0): int|false {}
  178. /** @tentative-return-type */
  179. public function fstat(): array {}
  180. /** @tentative-return-type */
  181. public function ftruncate(int $size): bool {}
  182. /** @tentative-return-type */
  183. public function current(): string|array|false {}
  184. /** @tentative-return-type */
  185. public function key(): int {}
  186. /** @tentative-return-type */
  187. public function next(): void {}
  188. /** @tentative-return-type */
  189. public function setFlags(int $flags): void {}
  190. /** @tentative-return-type */
  191. public function getFlags(): int {}
  192. /** @tentative-return-type */
  193. public function setMaxLineLen(int $maxLength): void {}
  194. /** @tentative-return-type */
  195. public function getMaxLineLen(): int {}
  196. /** @tentative-return-type */
  197. public function hasChildren(): bool {}
  198. /** @tentative-return-type */
  199. public function getChildren(): ?RecursiveIterator {}
  200. /** @tentative-return-type */
  201. public function seek(int $line): void {}
  202. /**
  203. * @tentative-return-type
  204. * @alias SplFileObject::fgets
  205. */
  206. public function getCurrentLine(): string {}
  207. /** @implementation-alias SplFileObject::fgets */
  208. public function __toString(): string {}
  209. }
  210. class SplTempFileObject extends SplFileObject
  211. {
  212. public function __construct(int $maxMemory = 2 * 1024 * 1024) {}
  213. }