php_reflection.stub.php 20 KB

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