php_reflection.stub.php 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763
  1. <?php
  2. /** @generate-class-entries */
  3. class ReflectionException extends Exception
  4. {
  5. }
  6. class Reflection
  7. {
  8. /** @tentative-return-type */
  9. public static function getModifierNames(int $modifiers): array {}
  10. }
  11. interface Reflector extends Stringable
  12. {
  13. }
  14. /** @not-serializable */
  15. abstract class ReflectionFunctionAbstract implements Reflector
  16. {
  17. public string $name;
  18. /** @implementation-alias ReflectionClass::__clone */
  19. private function __clone(): void {}
  20. /** @tentative-return-type */
  21. public function inNamespace(): bool {}
  22. /** @tentative-return-type */
  23. public function isClosure(): bool {}
  24. /** @tentative-return-type */
  25. public function isDeprecated(): bool {}
  26. /** @tentative-return-type */
  27. public function isInternal(): bool {}
  28. /** @tentative-return-type */
  29. public function isUserDefined(): bool {}
  30. /** @tentative-return-type */
  31. public function isGenerator(): bool {}
  32. /** @tentative-return-type */
  33. public function isVariadic(): bool {}
  34. /** @tentative-return-type */
  35. public function isStatic(): bool {}
  36. /** @tentative-return-type */
  37. public function getClosureThis(): ?object {}
  38. /** @tentative-return-type */
  39. public function getClosureScopeClass(): ?ReflectionClass {}
  40. public function getClosureUsedVariables(): array {}
  41. /** @tentative-return-type */
  42. public function getDocComment(): string|false {}
  43. /** @tentative-return-type */
  44. public function getEndLine(): int|false {}
  45. /** @tentative-return-type */
  46. public function getExtension(): ?ReflectionExtension {}
  47. /** @tentative-return-type */
  48. public function getExtensionName(): string|false {}
  49. /** @tentative-return-type */
  50. public function getFileName(): string|false {}
  51. /** @tentative-return-type */
  52. public function getName(): string {}
  53. /** @tentative-return-type */
  54. public function getNamespaceName(): string {}
  55. /** @tentative-return-type */
  56. public function getNumberOfParameters(): int {}
  57. /** @tentative-return-type */
  58. public function getNumberOfRequiredParameters(): int {}
  59. /** @tentative-return-type */
  60. public function getParameters(): array {}
  61. /** @tentative-return-type */
  62. public function getShortName(): string {}
  63. /** @tentative-return-type */
  64. public function getStartLine(): int|false {}
  65. /** @tentative-return-type */
  66. public function getStaticVariables(): array {}
  67. /** @tentative-return-type */
  68. public function returnsReference(): bool {}
  69. /** @tentative-return-type */
  70. public function hasReturnType(): bool {}
  71. /** @tentative-return-type */
  72. public function getReturnType(): ?ReflectionType {}
  73. public function hasTentativeReturnType(): bool {}
  74. public function getTentativeReturnType(): ?ReflectionType {}
  75. public function getAttributes(?string $name = null, int $flags = 0): array {}
  76. }
  77. class ReflectionFunction extends ReflectionFunctionAbstract
  78. {
  79. public function __construct(Closure|string $function) {}
  80. public function __toString(): string {}
  81. /**
  82. * @tentative-return-type
  83. * @deprecated ReflectionFunction can no longer be constructed for disabled functions
  84. */
  85. public function isDisabled(): bool {}
  86. /** @tentative-return-type */
  87. public function invoke(mixed ...$args): mixed {}
  88. /** @tentative-return-type */
  89. public function invokeArgs(array $args): mixed {}
  90. /** @tentative-return-type */
  91. public function getClosure(): Closure {}
  92. }
  93. /** @not-serializable */
  94. final class ReflectionGenerator
  95. {
  96. public function __construct(Generator $generator) {}
  97. /** @tentative-return-type */
  98. public function getExecutingLine(): int {}
  99. /** @tentative-return-type */
  100. public function getExecutingFile(): string {}
  101. /** @tentative-return-type */
  102. public function getTrace(int $options = DEBUG_BACKTRACE_PROVIDE_OBJECT): array {}
  103. /** @tentative-return-type */
  104. public function getFunction(): ReflectionFunctionAbstract {}
  105. /** @tentative-return-type */
  106. public function getThis(): ?object {}
  107. /** @tentative-return-type */
  108. public function getExecutingGenerator(): Generator {}
  109. }
  110. class ReflectionMethod extends ReflectionFunctionAbstract
  111. {
  112. public string $class;
  113. public function __construct(object|string $objectOrMethod, ?string $method = null) {}
  114. public function __toString(): string {}
  115. /** @tentative-return-type */
  116. public function isPublic(): bool {}
  117. /** @tentative-return-type */
  118. public function isPrivate(): bool {}
  119. /** @tentative-return-type */
  120. public function isProtected(): bool {}
  121. /** @tentative-return-type */
  122. public function isAbstract(): bool {}
  123. /** @tentative-return-type */
  124. public function isFinal(): bool {}
  125. /** @tentative-return-type */
  126. public function isConstructor(): bool {}
  127. /** @tentative-return-type */
  128. public function isDestructor(): bool {}
  129. /** @tentative-return-type */
  130. public function getClosure(?object $object = null): Closure {}
  131. /** @tentative-return-type */
  132. public function getModifiers(): int {}
  133. /** @tentative-return-type */
  134. public function invoke(?object $object, mixed ...$args): mixed {}
  135. /** @tentative-return-type */
  136. public function invokeArgs(?object $object, array $args): mixed {}
  137. /** @tentative-return-type */
  138. public function getDeclaringClass(): ReflectionClass {}
  139. /** @tentative-return-type */
  140. public function getPrototype(): ReflectionMethod {}
  141. /** @tentative-return-type */
  142. public function setAccessible(bool $accessible): void {}
  143. }
  144. /** @not-serializable */
  145. class ReflectionClass implements Reflector
  146. {
  147. public string $name;
  148. private function __clone(): void {}
  149. public function __construct(object|string $objectOrClass) {}
  150. public function __toString(): string {}
  151. /** @tentative-return-type */
  152. public function getName(): string {}
  153. /** @tentative-return-type */
  154. public function isInternal(): bool {}
  155. /** @tentative-return-type */
  156. public function isUserDefined(): bool {}
  157. /** @tentative-return-type */
  158. public function isAnonymous(): bool {}
  159. /** @tentative-return-type */
  160. public function isInstantiable(): bool {}
  161. /** @tentative-return-type */
  162. public function isCloneable(): bool {}
  163. /** @tentative-return-type */
  164. public function getFileName(): string|false {}
  165. /** @tentative-return-type */
  166. public function getStartLine(): int|false {}
  167. /** @tentative-return-type */
  168. public function getEndLine(): int|false {}
  169. /** @tentative-return-type */
  170. public function getDocComment(): string|false {}
  171. /** @tentative-return-type */
  172. public function getConstructor(): ?ReflectionMethod {}
  173. /** @tentative-return-type */
  174. public function hasMethod(string $name): bool {}
  175. /** @tentative-return-type */
  176. public function getMethod(string $name): ReflectionMethod {}
  177. /** @tentative-return-type */
  178. public function getMethods(?int $filter = null): array {}
  179. /** @tentative-return-type */
  180. public function hasProperty(string $name): bool {}
  181. /** @tentative-return-type */
  182. public function getProperty(string $name): ReflectionProperty {}
  183. /** @tentative-return-type */
  184. public function getProperties(?int $filter = null): array {}
  185. /** @tentative-return-type */
  186. public function hasConstant(string $name): bool {}
  187. /** @tentative-return-type */
  188. public function getConstants(?int $filter = null): array {}
  189. /** @tentative-return-type */
  190. public function getReflectionConstants(?int $filter = null): array {}
  191. /** @tentative-return-type */
  192. public function getConstant(string $name): mixed {}
  193. /** @tentative-return-type */
  194. public function getReflectionConstant(string $name): ReflectionClassConstant|false {}
  195. /** @tentative-return-type */
  196. public function getInterfaces(): array {}
  197. /** @tentative-return-type */
  198. public function getInterfaceNames(): array {}
  199. /** @tentative-return-type */
  200. public function isInterface(): bool {}
  201. /** @tentative-return-type */
  202. public function getTraits(): array {}
  203. /** @tentative-return-type */
  204. public function getTraitNames(): array {}
  205. /** @tentative-return-type */
  206. public function getTraitAliases(): array {}
  207. /** @tentative-return-type */
  208. public function isTrait(): bool {}
  209. public function isEnum(): bool {}
  210. /** @tentative-return-type */
  211. public function isAbstract(): bool {}
  212. /** @tentative-return-type */
  213. public function isFinal(): bool {}
  214. /** @tentative-return-type */
  215. public function getModifiers(): int {}
  216. /** @tentative-return-type */
  217. public function isInstance(object $object): bool {}
  218. /** @tentative-return-type */
  219. public function newInstance(mixed ...$args): object {}
  220. /** @tentative-return-type */
  221. public function newInstanceWithoutConstructor(): object {}
  222. /** @tentative-return-type */
  223. public function newInstanceArgs(array $args = []): ?object {}
  224. /** @tentative-return-type */
  225. public function getParentClass(): ReflectionClass|false {}
  226. /** @tentative-return-type */
  227. public function isSubclassOf(ReflectionClass|string $class): bool {}
  228. /** @tentative-return-type */
  229. public function getStaticProperties(): ?array {}
  230. /** @tentative-return-type */
  231. public function getStaticPropertyValue(string $name, mixed $default = UNKNOWN): mixed {}
  232. /** @tentative-return-type */
  233. public function setStaticPropertyValue(string $name, mixed $value): void {}
  234. /** @tentative-return-type */
  235. public function getDefaultProperties(): array {}
  236. /** @tentative-return-type */
  237. public function isIterable(): bool {}
  238. /**
  239. * @tentative-return-type
  240. * @alias ReflectionClass::isIterable
  241. */
  242. public function isIterateable(): bool {}
  243. /** @tentative-return-type */
  244. public function implementsInterface(ReflectionClass|string $interface): bool {}
  245. /** @tentative-return-type */
  246. public function getExtension(): ?ReflectionExtension {}
  247. /** @tentative-return-type */
  248. public function getExtensionName(): string|false {}
  249. /** @tentative-return-type */
  250. public function inNamespace(): bool {}
  251. /** @tentative-return-type */
  252. public function getNamespaceName(): string {}
  253. /** @tentative-return-type */
  254. public function getShortName(): string {}
  255. public function getAttributes(?string $name = null, int $flags = 0): array {}
  256. }
  257. class ReflectionObject extends ReflectionClass
  258. {
  259. public function __construct(object $object) {}
  260. }
  261. /** @not-serializable */
  262. class ReflectionProperty implements Reflector
  263. {
  264. public string $name;
  265. public string $class;
  266. /** @implementation-alias ReflectionClass::__clone */
  267. private function __clone(): void {}
  268. public function __construct(object|string $class, string $property) {}
  269. public function __toString(): string {}
  270. /** @tentative-return-type */
  271. public function getName(): string {}
  272. /** @tentative-return-type */
  273. public function getValue(?object $object = null): mixed {}
  274. /** @tentative-return-type */
  275. public function setValue(mixed $objectOrValue, mixed $value = UNKNOWN): void {}
  276. /** @tentative-return-type */
  277. public function isInitialized(?object $object = null): bool {}
  278. /** @tentative-return-type */
  279. public function isPublic(): bool {}
  280. /** @tentative-return-type */
  281. public function isPrivate(): bool {}
  282. /** @tentative-return-type */
  283. public function isProtected(): bool {}
  284. /** @tentative-return-type */
  285. public function isStatic(): bool {}
  286. public function isReadOnly(): bool {}
  287. /** @tentative-return-type */
  288. public function isDefault(): bool {}
  289. public function isPromoted(): bool {}
  290. /** @tentative-return-type */
  291. public function getModifiers(): int {}
  292. /** @tentative-return-type */
  293. public function getDeclaringClass(): ReflectionClass {}
  294. /** @tentative-return-type */
  295. public function getDocComment(): string|false {}
  296. /** @tentative-return-type */
  297. public function setAccessible(bool $accessible): void {}
  298. /** @tentative-return-type */
  299. public function getType(): ?ReflectionType {}
  300. /** @tentative-return-type */
  301. public function hasType(): bool {}
  302. public function hasDefaultValue(): bool {}
  303. /** @tentative-return-type */
  304. public function getDefaultValue(): mixed {}
  305. public function getAttributes(?string $name = null, int $flags = 0): array {}
  306. }
  307. /** @not-serializable */
  308. class ReflectionClassConstant implements Reflector
  309. {
  310. public string $name;
  311. public string $class;
  312. /** @implementation-alias ReflectionClass::__clone */
  313. private function __clone(): void {}
  314. public function __construct(object|string $class, string $constant) {}
  315. public function __toString(): string {}
  316. /** @tentative-return-type */
  317. public function getName(): string {}
  318. /** @tentative-return-type */
  319. public function getValue(): mixed {}
  320. /** @tentative-return-type */
  321. public function isPublic(): bool {}
  322. /** @tentative-return-type */
  323. public function isPrivate(): bool {}
  324. /** @tentative-return-type */
  325. public function isProtected(): bool {}
  326. public function isFinal(): bool {}
  327. /** @tentative-return-type */
  328. public function getModifiers(): int {}
  329. /** @tentative-return-type */
  330. public function getDeclaringClass(): ReflectionClass {}
  331. /** @tentative-return-type */
  332. public function getDocComment(): string|false {}
  333. public function getAttributes(?string $name = null, int $flags = 0): array {}
  334. public function isEnumCase(): bool {}
  335. }
  336. /** @not-serializable */
  337. class ReflectionParameter implements Reflector
  338. {
  339. public string $name;
  340. /** @implementation-alias ReflectionClass::__clone */
  341. private function __clone(): void {}
  342. /** @param string|array|object $function */
  343. public function __construct($function, int|string $param) {}
  344. public function __toString(): string {}
  345. /** @tentative-return-type */
  346. public function getName(): string {}
  347. /** @tentative-return-type */
  348. public function isPassedByReference(): bool {}
  349. /** @tentative-return-type */
  350. public function canBePassedByValue(): bool {}
  351. /** @tentative-return-type */
  352. public function getDeclaringFunction(): ReflectionFunctionAbstract {}
  353. /** @tentative-return-type */
  354. public function getDeclaringClass(): ?ReflectionClass {}
  355. /**
  356. * @tentative-return-type
  357. * @deprecated Use ReflectionParameter::getType() instead
  358. */
  359. public function getClass(): ?ReflectionClass {}
  360. /** @tentative-return-type */
  361. public function hasType(): bool {}
  362. /** @tentative-return-type */
  363. public function getType(): ?ReflectionType {}
  364. /**
  365. * @tentative-return-type
  366. * @deprecated Use ReflectionParameter::getType() instead
  367. */
  368. public function isArray(): bool {}
  369. /**
  370. * @tentative-return-type
  371. * @deprecated Use ReflectionParameter::getType() instead
  372. */
  373. public function isCallable(): bool {}
  374. /** @tentative-return-type */
  375. public function allowsNull(): bool {}
  376. /** @tentative-return-type */
  377. public function getPosition(): int {}
  378. /** @tentative-return-type */
  379. public function isOptional(): bool {}
  380. /** @tentative-return-type */
  381. public function isDefaultValueAvailable(): bool {}
  382. /** @tentative-return-type */
  383. public function getDefaultValue(): mixed {}
  384. /** @tentative-return-type */
  385. public function isDefaultValueConstant(): bool {}
  386. /** @tentative-return-type */
  387. public function getDefaultValueConstantName(): ?string {}
  388. /** @tentative-return-type */
  389. public function isVariadic(): bool {}
  390. public function isPromoted(): bool {}
  391. public function getAttributes(?string $name = null, int $flags = 0): array {}
  392. }
  393. /** @not-serializable */
  394. abstract class ReflectionType implements Stringable
  395. {
  396. /** @implementation-alias ReflectionClass::__clone */
  397. private function __clone(): void {}
  398. /** @tentative-return-type */
  399. public function allowsNull(): bool {}
  400. public function __toString(): string {}
  401. }
  402. class ReflectionNamedType extends ReflectionType
  403. {
  404. /** @tentative-return-type */
  405. public function getName(): string {}
  406. /** @tentative-return-type */
  407. public function isBuiltin(): bool {}
  408. }
  409. class ReflectionUnionType extends ReflectionType
  410. {
  411. public function getTypes(): array {}
  412. }
  413. class ReflectionIntersectionType extends ReflectionType
  414. {
  415. public function getTypes(): array {}
  416. }
  417. /** @not-serializable */
  418. class ReflectionExtension implements Reflector
  419. {
  420. public string $name;
  421. /** @implementation-alias ReflectionClass::__clone */
  422. private function __clone(): void {}
  423. public function __construct(string $name) {}
  424. public function __toString(): string {}
  425. /** @tentative-return-type */
  426. public function getName(): string {}
  427. /** @tentative-return-type */
  428. public function getVersion(): ?string {}
  429. /** @tentative-return-type */
  430. public function getFunctions(): array {}
  431. /** @tentative-return-type */
  432. public function getConstants(): array {}
  433. /** @tentative-return-type */
  434. public function getINIEntries(): array {}
  435. /** @tentative-return-type */
  436. public function getClasses(): array {}
  437. /** @tentative-return-type */
  438. public function getClassNames(): array {}
  439. /** @tentative-return-type */
  440. public function getDependencies(): array {}
  441. /** @tentative-return-type */
  442. public function info(): void {}
  443. /** @tentative-return-type */
  444. public function isPersistent(): bool {}
  445. /** @tentative-return-type */
  446. public function isTemporary(): bool {}
  447. }
  448. /** @not-serializable */
  449. class ReflectionZendExtension implements Reflector
  450. {
  451. public string $name;
  452. /** @implementation-alias ReflectionClass::__clone */
  453. private function __clone(): void {}
  454. public function __construct(string $name) {}
  455. public function __toString(): string {}
  456. /** @tentative-return-type */
  457. public function getName(): string {}
  458. /** @tentative-return-type */
  459. public function getVersion(): string {}
  460. /** @tentative-return-type */
  461. public function getAuthor(): string {}
  462. /** @tentative-return-type */
  463. public function getURL(): string {}
  464. /** @tentative-return-type */
  465. public function getCopyright(): string {}
  466. }
  467. /** @not-serializable */
  468. final class ReflectionReference
  469. {
  470. public static function fromArrayElement(array $array, int|string $key): ?ReflectionReference {}
  471. public function getId(): string {}
  472. /** @implementation-alias ReflectionClass::__clone */
  473. private function __clone(): void {}
  474. private function __construct() {}
  475. }
  476. /** @not-serializable */
  477. class ReflectionAttribute implements Reflector
  478. {
  479. public function getName(): string {}
  480. public function getTarget(): int {}
  481. public function isRepeated(): bool {}
  482. public function getArguments(): array {}
  483. public function newInstance(): object {}
  484. public function __toString(): string {}
  485. private function __clone(): void {}
  486. private function __construct() {}
  487. }
  488. class ReflectionEnum extends ReflectionClass
  489. {
  490. public function __construct(object|string $objectOrClass) {}
  491. public function hasCase(string $name): bool {}
  492. public function getCase(string $name): ReflectionEnumUnitCase {}
  493. public function getCases(): array {}
  494. public function isBacked(): bool {}
  495. public function getBackingType(): ?ReflectionType {}
  496. }
  497. class ReflectionEnumUnitCase extends ReflectionClassConstant
  498. {
  499. public function __construct(object|string $class, string $constant) {}
  500. public function getEnum(): ReflectionEnum {}
  501. /**
  502. * @implementation-alias ReflectionClassConstant::getValue
  503. * @no-verify
  504. */
  505. public function getValue(): UnitEnum {}
  506. }
  507. class ReflectionEnumBackedCase extends ReflectionEnumUnitCase
  508. {
  509. public function __construct(object|string $class, string $constant) {}
  510. public function getBackingValue(): int|string {}
  511. }
  512. /** @not-serializable */
  513. final class ReflectionFiber
  514. {
  515. public function __construct(Fiber $fiber) {}
  516. public function getFiber(): Fiber {}
  517. public function getExecutingFile(): string {}
  518. public function getExecutingLine(): int {}
  519. public function getCallable(): callable {}
  520. public function getTrace(int $options = DEBUG_BACKTRACE_PROVIDE_OBJECT): array {}
  521. }