phar_object.stub.php 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526
  1. <?php
  2. /** @generate-class-entries */
  3. class PharException extends Exception
  4. {
  5. }
  6. class Phar extends RecursiveDirectoryIterator implements Countable, ArrayAccess
  7. {
  8. public function __construct(string $filename, int $flags = FilesystemIterator::SKIP_DOTS|FilesystemIterator::UNIX_PATHS, ?string $alias = null) {}
  9. public function __destruct() {}
  10. /** @tentative-return-type */
  11. public function addEmptyDir(string $directory): void {}
  12. /** @tentative-return-type */
  13. public function addFile(string $filename, ?string $localName = null): void {}
  14. /** @tentative-return-type */
  15. public function addFromString(string $localName, string $contents): void {}
  16. /** @tentative-return-type */
  17. public function buildFromDirectory(string $directory, string $pattern = ""): array {}
  18. /** @tentative-return-type */
  19. public function buildFromIterator(Traversable $iterator, ?string $baseDirectory = null): array {}
  20. /** @tentative-return-type */
  21. public function compressFiles(int $compression): void {}
  22. /** @return bool */
  23. public function decompressFiles() {} // TODO make return type void
  24. /** @tentative-return-type */
  25. public function compress(int $compression, ?string $extension = null): ?Phar {}
  26. /** @tentative-return-type */
  27. public function decompress(?string $extension = null): ?Phar {}
  28. /** @tentative-return-type */
  29. public function convertToExecutable(?int $format = null, ?int $compression = null, ?string $extension = null): ?Phar {}
  30. /** @tentative-return-type */
  31. public function convertToData(?int $format = null, ?int $compression = null, ?string $extension = null): ?PharData {}
  32. /** @return bool */
  33. public function copy(string $from, string $to) {} // TODO make return type void
  34. /** @tentative-return-type */
  35. public function count(int $mode = COUNT_NORMAL): int {}
  36. /** @return bool */
  37. public function delete(string $localName) {} // TODO make return type void
  38. /** @return bool */
  39. public function delMetadata() {} // TODO make return type void
  40. /** @tentative-return-type */
  41. public function extractTo(string $directory, array|string|null $files = null, bool $overwrite = false): bool {}
  42. /** @tentative-return-type */
  43. public function getAlias(): ?string {}
  44. /** @tentative-return-type */
  45. public function getPath(): string {}
  46. /** @tentative-return-type */
  47. public function getMetadata(array $unserializeOptions = []): mixed {}
  48. /** @tentative-return-type */
  49. public function getModified(): bool {}
  50. /** @tentative-return-type */
  51. public function getSignature(): array|false {}
  52. /** @tentative-return-type */
  53. public function getStub(): string {}
  54. /** @tentative-return-type */
  55. public function getVersion(): string {}
  56. /** @tentative-return-type */
  57. public function hasMetadata(): bool {}
  58. /** @tentative-return-type */
  59. public function isBuffering(): bool {}
  60. /** @tentative-return-type */
  61. public function isCompressed(): int|false {}
  62. /** @tentative-return-type */
  63. public function isFileFormat(int $format): bool {}
  64. /** @tentative-return-type */
  65. public function isWritable(): bool {}
  66. /**
  67. * @param string $localName
  68. * @tentative-return-type
  69. */
  70. public function offsetExists($localName): bool {}
  71. /**
  72. * @param string $localName
  73. * @tentative-return-type
  74. */
  75. public function offsetGet($localName): SplFileInfo {}
  76. /**
  77. * @param string $localName
  78. * @param resource|string $value
  79. * @tentative-return-type
  80. */
  81. public function offsetSet($localName, $value): void {}
  82. /**
  83. * @param string $localName
  84. * @tentative-return-type
  85. */
  86. public function offsetUnset($localName): void {}
  87. /** @tentative-return-type */
  88. public function setAlias(string $alias): bool {}
  89. /** @tentative-return-type */
  90. public function setDefaultStub(?string $index = null, ?string $webIndex = null): bool {}
  91. /** @tentative-return-type */
  92. public function setMetadata(mixed $metadata): void {}
  93. /** @tentative-return-type */
  94. public function setSignatureAlgorithm(int $algo, ?string $privateKey = null): void {}
  95. /**
  96. * @param resource|string $stub
  97. * @return bool
  98. */
  99. public function setStub($stub, int $length = UNKNOWN) {} // TODO make return type void
  100. /** @tentative-return-type */
  101. public function startBuffering(): void {}
  102. /** @tentative-return-type */
  103. public function stopBuffering(): void {}
  104. final public static function apiVersion(): string {}
  105. final public static function canCompress(int $compression = 0): bool {}
  106. final public static function canWrite(): bool {}
  107. final public static function createDefaultStub(?string $index = null, ?string $webIndex = null): string {}
  108. final public static function getSupportedCompression(): array {}
  109. final public static function getSupportedSignatures(): array {}
  110. final public static function interceptFileFuncs(): void {}
  111. final public static function isValidPharFilename(string $filename, bool $executable = true): bool {}
  112. final public static function loadPhar(string $filename, ?string $alias = null): bool {}
  113. final public static function mapPhar(?string $alias = null, int $offset = 0): bool {}
  114. final public static function running(bool $returnPhar = true): string {}
  115. final public static function mount(string $pharPath, string $externalPath): void {}
  116. final public static function mungServer(array $variables): void {}
  117. final public static function unlinkArchive(string $filename): bool {} // TODO make return type void
  118. final public static function webPhar(
  119. ?string $alias = null, ?string $index = null, ?string $fileNotFoundScript = null,
  120. array $mimeTypes = [], ?callable $rewrite = null): void {}
  121. }
  122. class PharData extends RecursiveDirectoryIterator implements Countable, ArrayAccess
  123. {
  124. /**
  125. * @implementation-alias Phar::__construct
  126. * @no-verify PharData constructor accepts extra $format argument
  127. */
  128. public function __construct(string $filename, int $flags = FilesystemIterator::SKIP_DOTS|FilesystemIterator::UNIX_PATHS, ?string $alias = null, int $format = 0) {}
  129. /** @implementation-alias Phar::__destruct */
  130. public function __destruct() {}
  131. /**
  132. * @tentative-return-type
  133. * @implementation-alias Phar::addEmptyDir
  134. */
  135. public function addEmptyDir(string $directory): void {}
  136. /**
  137. * @tentative-return-type
  138. * @implementation-alias Phar::addFile
  139. */
  140. public function addFile(string $filename, ?string $localName = null): void {}
  141. /**
  142. * @tentative-return-type
  143. * @implementation-alias Phar::addFromString
  144. */
  145. public function addFromString(string $localName, string $contents): void {}
  146. /**
  147. * @tentative-return-type
  148. * @implementation-alias Phar::buildFromDirectory
  149. */
  150. public function buildFromDirectory(string $directory, string $pattern = ""): array {}
  151. /**
  152. * @tentative-return-type
  153. * @implementation-alias Phar::buildFromIterator
  154. */
  155. public function buildFromIterator(Traversable $iterator, ?string $baseDirectory = null): array {}
  156. /**
  157. * @tentative-return-type
  158. * @implementation-alias Phar::compressFiles
  159. */
  160. public function compressFiles(int $compression): void {}
  161. /**
  162. * @return bool
  163. * @implementation-alias Phar::decompressFiles
  164. */
  165. public function decompressFiles() {} // TODO make return type void
  166. /**
  167. * @tentative-return-type
  168. * @implementation-alias Phar::compress
  169. * @no-verify
  170. */
  171. public function compress(int $compression, ?string $extension = null): ?PharData {}
  172. /**
  173. * @tentative-return-type
  174. * @implementation-alias Phar::decompress
  175. * @no-verify
  176. */
  177. public function decompress(?string $extension = null): ?PharData {}
  178. /**
  179. * @tentative-return-type
  180. * @implementation-alias Phar::convertToExecutable
  181. */
  182. public function convertToExecutable(?int $format = null, ?int $compression = null, ?string $extension = null): ?Phar {}
  183. /**
  184. * @tentative-return-type
  185. * @implementation-alias Phar::convertToData
  186. */
  187. public function convertToData(?int $format = null, ?int $compression = null, ?string $extension = null): ?PharData {}
  188. /**
  189. * @return bool
  190. * @implementation-alias Phar::copy
  191. */
  192. public function copy(string $from, string $to) {} // TODO make return type void
  193. /**
  194. * @tentative-return-type
  195. * @implementation-alias Phar::count
  196. */
  197. public function count(int $mode = COUNT_NORMAL): int {}
  198. /**
  199. * @return bool
  200. * @implementation-alias Phar::delete
  201. */
  202. public function delete(string $localName) {} // TODO make return type void
  203. /**
  204. * @return bool
  205. * @implementation-alias Phar::delMetadata
  206. */
  207. public function delMetadata() {} // TODO make return type void
  208. /**
  209. * @tentative-return-type
  210. * @implementation-alias Phar::extractTo
  211. */
  212. public function extractTo(string $directory, array|string|null $files = null, bool $overwrite = false): bool {}
  213. /**
  214. * @tentative-return-type
  215. * @implementation-alias Phar::getAlias
  216. */
  217. public function getAlias(): ?string {}
  218. /**
  219. * @tentative-return-type
  220. * @implementation-alias Phar::getPath
  221. */
  222. public function getPath(): string {}
  223. /**
  224. * @tentative-return-type
  225. * @implementation-alias Phar::getMetadata
  226. */
  227. public function getMetadata(array $unserializeOptions = []): mixed {}
  228. /**
  229. * @tentative-return-type
  230. * @implementation-alias Phar::getModified
  231. */
  232. public function getModified(): bool {}
  233. /**
  234. * @tentative-return-type
  235. * @implementation-alias Phar::getSignature
  236. */
  237. public function getSignature(): array|false {}
  238. /**
  239. * @tentative-return-type
  240. * @implementation-alias Phar::getStub
  241. */
  242. public function getStub(): string {}
  243. /**
  244. * @tentative-return-type
  245. * @implementation-alias Phar::getVersion
  246. */
  247. public function getVersion(): string {}
  248. /**
  249. * @tentative-return-type
  250. * @implementation-alias Phar::hasMetadata
  251. */
  252. public function hasMetadata(): bool {}
  253. /**
  254. * @tentative-return-type
  255. * @implementation-alias Phar::isBuffering
  256. */
  257. public function isBuffering(): bool {}
  258. /**
  259. * @tentative-return-type
  260. * @implementation-alias Phar::isCompressed
  261. */
  262. public function isCompressed(): int|false {}
  263. /**
  264. * @tentative-return-type
  265. * @implementation-alias Phar::isFileFormat
  266. */
  267. public function isFileFormat(int $format): bool {}
  268. /**
  269. * @tentative-return-type
  270. * @implementation-alias Phar::isWritable
  271. */
  272. public function isWritable(): bool {}
  273. /**
  274. * @param string $localName
  275. * @tentative-return-type
  276. * @implementation-alias Phar::offsetExists
  277. */
  278. public function offsetExists($localName): bool {}
  279. /**
  280. * @param string $localName
  281. * @tentative-return-type
  282. * @implementation-alias Phar::offsetGet
  283. */
  284. public function offsetGet($localName): SplFileInfo {}
  285. /**
  286. * @param string $localName
  287. * @param resource|string $value
  288. * @tentative-return-type
  289. * @implementation-alias Phar::offsetSet
  290. */
  291. public function offsetSet($localName, $value): void {}
  292. /**
  293. * @param string $localName
  294. * @tentative-return-type
  295. * @implementation-alias Phar::offsetUnset
  296. */
  297. public function offsetUnset($localName): void {}
  298. /**
  299. * @tentative-return-type
  300. * @implementation-alias Phar::setAlias
  301. */
  302. public function setAlias(string $alias): bool {}
  303. /**
  304. * @tentative-return-type
  305. * @implementation-alias Phar::setDefaultStub
  306. */
  307. public function setDefaultStub(?string $index = null, ?string $webIndex = null): bool {}
  308. /**
  309. * @tentative-return-type
  310. * @implementation-alias Phar::setMetadata
  311. */
  312. public function setMetadata(mixed $metadata): void {}
  313. /**
  314. * @tentative-return-type
  315. * @implementation-alias Phar::setSignatureAlgorithm
  316. */
  317. public function setSignatureAlgorithm(int $algo, ?string $privateKey = null): void {}
  318. /**
  319. * @param resource|string $stub
  320. * @return bool
  321. * @implementation-alias Phar::setStub
  322. */
  323. public function setStub($stub, int $length = UNKNOWN) {} // TODO make return type void
  324. /**
  325. * @tentative-return-type
  326. * @implementation-alias Phar::startBuffering
  327. */
  328. public function startBuffering(): void {}
  329. /**
  330. * @tentative-return-type
  331. * @implementation-alias Phar::stopBuffering
  332. */
  333. public function stopBuffering(): void {}
  334. /** @implementation-alias Phar::apiVersion */
  335. final public static function apiVersion(): string {}
  336. /** @implementation-alias Phar::canCompress */
  337. final public static function canCompress(int $compression = 0): bool {}
  338. /** @implementation-alias Phar::canWrite */
  339. final public static function canWrite(): bool {}
  340. /** @implementation-alias Phar::createDefaultStub */
  341. final public static function createDefaultStub(?string $index = null, ?string $webIndex = null): string {}
  342. /** @implementation-alias Phar::getSupportedCompression */
  343. final public static function getSupportedCompression(): array {}
  344. /** @implementation-alias Phar::getSupportedSignatures */
  345. final public static function getSupportedSignatures(): array {}
  346. /** @implementation-alias Phar::interceptFileFuncs */
  347. final public static function interceptFileFuncs(): void {}
  348. /** @implementation-alias Phar::isValidPharFilename */
  349. final public static function isValidPharFilename(string $filename, bool $executable = true): bool {}
  350. /** @implementation-alias Phar::loadPhar */
  351. final public static function loadPhar(string $filename, ?string $alias = null): bool {}
  352. /** @implementation-alias Phar::mapPhar */
  353. final public static function mapPhar(?string $alias = null, int $offset = 0): bool {}
  354. /** @implementation-alias Phar::running */
  355. final public static function running(bool $returnPhar = true): string {}
  356. /** @implementation-alias Phar::mount */
  357. final public static function mount(string $pharPath, string $externalPath): void {}
  358. /** @implementation-alias Phar::mungServer */
  359. final public static function mungServer(array $variables): void {}
  360. /** @implementation-alias Phar::unlinkArchive */
  361. final public static function unlinkArchive(string $filename): bool {} // TODO make return type void
  362. /** @implementation-alias Phar::webPhar */
  363. final public static function webPhar(
  364. ?string $alias = null, ?string $index = null, ?string $fileNotFoundScript = null,
  365. array $mimeTypes = [], ?callable $rewrite = null): void {}
  366. }
  367. class PharFileInfo extends SplFileInfo
  368. {
  369. public function __construct(string $filename) {}
  370. public function __destruct() {}
  371. /** @tentative-return-type */
  372. public function chmod(int $perms): void {}
  373. /** @return bool */
  374. public function compress(int $compression) {} // TODO make return type void
  375. /** @return bool */
  376. public function decompress() {} // TODO make return type void
  377. /** @return bool */
  378. public function delMetadata() {} // TODO make return type void
  379. /** @tentative-return-type */
  380. public function getCompressedSize(): int {}
  381. /** @tentative-return-type */
  382. public function getCRC32(): int {}
  383. /** @tentative-return-type */
  384. public function getContent(): string {}
  385. /** @tentative-return-type */
  386. public function getMetadata(array $unserializeOptions = []): mixed {}
  387. /** @tentative-return-type */
  388. public function getPharFlags(): int {}
  389. /** @tentative-return-type */
  390. public function hasMetadata(): bool {}
  391. /** @tentative-return-type */
  392. public function isCompressed(?int $compression = null): bool {}
  393. /** @tentative-return-type */
  394. public function isCRCChecked(): bool {}
  395. /** @tentative-return-type */
  396. public function setMetadata(mixed $metadata): void {}
  397. }