1<?php
2
3/** @generate-class-entries */
4
5class ReflectionException extends Exception
6{
7}
8
9class Reflection
10{
11    /** @tentative-return-type */
12    public static function getModifierNames(int $modifiers): array {}
13}
14
15interface Reflector extends Stringable
16{
17}
18
19/** @not-serializable */
20abstract class ReflectionFunctionAbstract implements Reflector
21{
22    public string $name;
23
24    /** @implementation-alias ReflectionClass::__clone */
25    private function __clone(): void {}
26
27    /** @tentative-return-type */
28    public function inNamespace(): bool {}
29
30    /** @tentative-return-type */
31    public function isClosure(): bool {}
32
33    /** @tentative-return-type */
34    public function isDeprecated(): bool {}
35
36    /** @tentative-return-type */
37    public function isInternal(): bool {}
38
39    /** @tentative-return-type */
40    public function isUserDefined(): bool {}
41
42    /** @tentative-return-type */
43    public function isGenerator(): bool {}
44
45    /** @tentative-return-type */
46    public function isVariadic(): bool {}
47
48    /** @tentative-return-type */
49    public function isStatic(): bool {}
50
51    /** @tentative-return-type */
52    public function getClosureThis(): ?object {}
53
54    /** @tentative-return-type */
55    public function getClosureScopeClass(): ?ReflectionClass {}
56
57    /** @tentative-return-type */
58    public function getClosureCalledClass(): ?ReflectionClass {}
59
60    public function getClosureUsedVariables(): array {}
61
62    /** @tentative-return-type */
63    public function getDocComment(): string|false {}
64
65    /** @tentative-return-type */
66    public function getEndLine(): int|false {}
67
68    /** @tentative-return-type */
69    public function getExtension(): ?ReflectionExtension {}
70
71    /** @tentative-return-type */
72    public function getExtensionName(): string|false {}
73
74    /** @tentative-return-type */
75    public function getFileName(): string|false {}
76
77    /** @tentative-return-type */
78    public function getName(): string {}
79
80    /** @tentative-return-type */
81    public function getNamespaceName(): string {}
82
83    /** @tentative-return-type */
84    public function getNumberOfParameters(): int {}
85
86    /** @tentative-return-type */
87    public function getNumberOfRequiredParameters(): int {}
88
89    /** @tentative-return-type */
90    public function getParameters(): array {}
91
92    /** @tentative-return-type */
93    public function getShortName(): string {}
94
95    /** @tentative-return-type */
96    public function getStartLine(): int|false {}
97
98    /** @tentative-return-type */
99    public function getStaticVariables(): array {}
100
101    /** @tentative-return-type */
102    public function returnsReference(): bool {}
103
104    /** @tentative-return-type */
105    public function hasReturnType(): bool {}
106
107    /** @tentative-return-type */
108    public function getReturnType(): ?ReflectionType {}
109
110    public function hasTentativeReturnType(): bool {}
111
112    public function getTentativeReturnType(): ?ReflectionType {}
113
114    public function getAttributes(?string $name = null, int $flags = 0): array {}
115}
116
117class ReflectionFunction extends ReflectionFunctionAbstract
118{
119    /** @cvalue ZEND_ACC_DEPRECATED */
120    public const int IS_DEPRECATED = UNKNOWN;
121
122    public function __construct(Closure|string $function) {}
123
124    public function __toString(): string {}
125
126    public function isAnonymous(): bool {}
127
128    /**
129     * @tentative-return-type
130     * @deprecated ReflectionFunction can no longer be constructed for disabled functions
131     */
132    public function isDisabled(): bool {}
133
134    /** @tentative-return-type */
135    public function invoke(mixed ...$args): mixed {}
136
137    /** @tentative-return-type */
138    public function invokeArgs(array $args): mixed {}
139
140    /** @tentative-return-type */
141    public function getClosure(): Closure {}
142}
143
144/** @not-serializable */
145final class ReflectionGenerator
146{
147    public function __construct(Generator $generator) {}
148
149    /** @tentative-return-type */
150    public function getExecutingLine(): int {}
151
152    /** @tentative-return-type */
153    public function getExecutingFile(): string {}
154
155    /** @tentative-return-type */
156    public function getTrace(int $options = DEBUG_BACKTRACE_PROVIDE_OBJECT): array {}
157
158    /** @tentative-return-type */
159    public function getFunction(): ReflectionFunctionAbstract {}
160
161    /** @tentative-return-type */
162    public function getThis(): ?object {}
163
164    /** @tentative-return-type */
165    public function getExecutingGenerator(): Generator {}
166
167    public function isClosed(): bool {}
168}
169
170class ReflectionMethod extends ReflectionFunctionAbstract
171{
172    /** @cvalue ZEND_ACC_STATIC */
173    public const int IS_STATIC = UNKNOWN;
174    /** @cvalue ZEND_ACC_PUBLIC */
175    public const int IS_PUBLIC = UNKNOWN;
176    /** @cvalue ZEND_ACC_PROTECTED */
177    public const int IS_PROTECTED = UNKNOWN;
178    /** @cvalue ZEND_ACC_PRIVATE */
179    public const int IS_PRIVATE = UNKNOWN;
180    /** @cvalue ZEND_ACC_ABSTRACT */
181    public const int IS_ABSTRACT = UNKNOWN;
182    /** @cvalue ZEND_ACC_FINAL */
183    public const int IS_FINAL = UNKNOWN;
184
185    public string $class;
186
187    public function __construct(object|string $objectOrMethod, ?string $method = null) {}
188
189    public static function createFromMethodName(string $method): static {}
190
191    public function __toString(): string {}
192
193    /** @tentative-return-type */
194    public function isPublic(): bool {}
195
196    /** @tentative-return-type */
197    public function isPrivate(): bool {}
198
199    /** @tentative-return-type */
200    public function isProtected(): bool {}
201
202    /** @tentative-return-type */
203    public function isAbstract(): bool {}
204
205    /** @tentative-return-type */
206    public function isFinal(): bool {}
207
208    /** @tentative-return-type */
209    public function isConstructor(): bool {}
210
211    /** @tentative-return-type */
212    public function isDestructor(): bool {}
213
214    /** @tentative-return-type */
215    public function getClosure(?object $object = null): Closure {}
216
217    /** @tentative-return-type */
218    public function getModifiers(): int {}
219
220    /** @tentative-return-type */
221    public function invoke(?object $object, mixed ...$args): mixed {}
222
223    /** @tentative-return-type */
224    public function invokeArgs(?object $object, array $args): mixed {}
225
226    /** @tentative-return-type */
227    public function getDeclaringClass(): ReflectionClass {}
228
229    /** @tentative-return-type */
230    public function getPrototype(): ReflectionMethod {}
231
232    public function hasPrototype(): bool {}
233
234    /** @tentative-return-type */
235    public function setAccessible(bool $accessible): void {}
236}
237
238/** @not-serializable */
239class ReflectionClass implements Reflector
240{
241    /**
242     * @cvalue ZEND_ACC_IMPLICIT_ABSTRACT_CLASS
243     * @todo deprecate
244     */
245    public const int IS_IMPLICIT_ABSTRACT = UNKNOWN;
246    /** @cvalue ZEND_ACC_EXPLICIT_ABSTRACT_CLASS */
247    public const int IS_EXPLICIT_ABSTRACT = UNKNOWN;
248    /** @cvalue ZEND_ACC_FINAL */
249    public const int IS_FINAL = UNKNOWN;
250    /** @cvalue ZEND_ACC_READONLY_CLASS */
251    public const int IS_READONLY = UNKNOWN;
252
253    public string $name;
254
255    private function __clone(): void {}
256
257    public function __construct(object|string $objectOrClass) {}
258
259    public function __toString(): string {}
260
261    /** @tentative-return-type */
262    public function getName(): string {}
263
264    /** @tentative-return-type */
265    public function isInternal(): bool {}
266
267    /** @tentative-return-type */
268    public function isUserDefined(): bool {}
269
270    /** @tentative-return-type */
271    public function isAnonymous(): bool {}
272
273    /** @tentative-return-type */
274    public function isInstantiable(): bool {}
275
276    /** @tentative-return-type */
277    public function isCloneable(): bool {}
278
279    /** @tentative-return-type */
280    public function getFileName(): string|false {}
281
282    /** @tentative-return-type */
283    public function getStartLine(): int|false {}
284
285    /** @tentative-return-type */
286    public function getEndLine(): int|false {}
287
288    /** @tentative-return-type */
289    public function getDocComment(): string|false {}
290
291    /** @tentative-return-type */
292    public function getConstructor(): ?ReflectionMethod {}
293
294    /** @tentative-return-type */
295    public function hasMethod(string $name): bool {}
296
297    /** @tentative-return-type */
298    public function getMethod(string $name): ReflectionMethod {}
299
300    /** @tentative-return-type */
301    public function getMethods(?int $filter = null): array {}
302
303    /** @tentative-return-type */
304    public function hasProperty(string $name): bool {}
305
306    /** @tentative-return-type */
307    public function getProperty(string $name): ReflectionProperty {}
308
309    /** @tentative-return-type */
310    public function getProperties(?int $filter = null): array {}
311
312    /** @tentative-return-type */
313    public function hasConstant(string $name): bool {}
314
315    /** @tentative-return-type */
316    public function getConstants(?int $filter = null): array {}
317
318    /** @tentative-return-type */
319    public function getReflectionConstants(?int $filter = null): array {}
320
321    /** @tentative-return-type */
322    public function getConstant(string $name): mixed {} // TODO throw exception when the constant doesn't exist
323
324    /** @tentative-return-type */
325    public function getReflectionConstant(string $name): ReflectionClassConstant|false {}
326
327    /** @tentative-return-type */
328    public function getInterfaces(): array {}
329
330    /** @tentative-return-type */
331    public function getInterfaceNames(): array {}
332
333    /** @tentative-return-type */
334    public function isInterface(): bool {}
335
336    /** @tentative-return-type */
337    public function getTraits(): array {}
338
339    /** @tentative-return-type */
340    public function getTraitNames(): array {}
341
342    /** @tentative-return-type */
343    public function getTraitAliases(): array {}
344
345    /** @tentative-return-type */
346    public function isTrait(): bool {}
347
348    public function isEnum(): bool {}
349
350    /** @tentative-return-type */
351    public function isAbstract(): bool {}
352
353    /** @tentative-return-type */
354    public function isFinal(): bool {}
355
356    public function isReadOnly(): bool {}
357
358    /** @tentative-return-type */
359    public function getModifiers(): int {}
360
361    /** @tentative-return-type */
362    public function isInstance(object $object): bool {}
363
364    /** @tentative-return-type */
365    public function newInstance(mixed ...$args): object {}
366
367    /** @tentative-return-type */
368    public function newInstanceWithoutConstructor(): object {}
369
370    /** @tentative-return-type */
371    public function newInstanceArgs(array $args = []): ?object {}
372
373    /** @tentative-return-type */
374    public function getParentClass(): ReflectionClass|false {}
375
376    /** @tentative-return-type */
377    public function isSubclassOf(ReflectionClass|string $class): bool {}
378
379    /** @tentative-return-type */
380    public function getStaticProperties(): array {}
381
382    /** @tentative-return-type */
383    public function getStaticPropertyValue(string $name, mixed $default = UNKNOWN): mixed {}
384
385    /** @tentative-return-type */
386    public function setStaticPropertyValue(string $name, mixed $value): void {}
387
388    /** @tentative-return-type */
389    public function getDefaultProperties(): array {}
390
391    /** @tentative-return-type */
392    public function isIterable(): bool {}
393
394    /**
395     * @tentative-return-type
396     * @alias ReflectionClass::isIterable
397     */
398    public function isIterateable(): bool {}
399
400    /** @tentative-return-type */
401    public function implementsInterface(ReflectionClass|string $interface): bool {}
402
403    /** @tentative-return-type */
404    public function getExtension(): ?ReflectionExtension {}
405
406    /** @tentative-return-type */
407    public function getExtensionName(): string|false {}
408
409    /** @tentative-return-type */
410    public function inNamespace(): bool {}
411
412    /** @tentative-return-type */
413    public function getNamespaceName(): string {}
414
415    /** @tentative-return-type */
416    public function getShortName(): string {}
417
418    public function getAttributes(?string $name = null, int $flags = 0): array {}
419}
420
421class ReflectionObject extends ReflectionClass
422{
423    public function __construct(object $object) {}
424}
425
426/** @not-serializable */
427class ReflectionProperty implements Reflector
428{
429    /** @cvalue ZEND_ACC_STATIC */
430    public const int IS_STATIC = UNKNOWN;
431    /** @cvalue ZEND_ACC_READONLY */
432    public const int IS_READONLY = UNKNOWN;
433    /** @cvalue ZEND_ACC_PUBLIC */
434    public const int IS_PUBLIC = UNKNOWN;
435    /** @cvalue ZEND_ACC_PROTECTED */
436    public const int IS_PROTECTED = UNKNOWN;
437    /** @cvalue ZEND_ACC_PRIVATE */
438    public const int IS_PRIVATE = UNKNOWN;
439
440    public string $name;
441    public string $class;
442
443    /** @implementation-alias ReflectionClass::__clone */
444    private function __clone(): void {}
445
446    public function __construct(object|string $class, string $property) {}
447
448    public function __toString(): string {}
449
450    /** @tentative-return-type */
451    public function getName(): string {}
452
453    /** @tentative-return-type */
454    public function getValue(?object $object = null): mixed {}
455
456    /** @tentative-return-type */
457    public function setValue(mixed $objectOrValue, mixed $value = UNKNOWN): void {}
458
459    /** @tentative-return-type */
460    public function isInitialized(?object $object = null): bool {}
461
462    /** @tentative-return-type */
463    public function isPublic(): bool {}
464
465    /** @tentative-return-type */
466    public function isPrivate(): bool {}
467
468    /** @tentative-return-type */
469    public function isProtected(): bool {}
470
471    /** @tentative-return-type */
472    public function isStatic(): bool {}
473
474    public function isReadOnly(): bool {}
475
476    /** @tentative-return-type */
477    public function isDefault(): bool {}
478
479    public function isPromoted(): bool {}
480
481    /** @tentative-return-type */
482    public function getModifiers(): int {}
483
484    /** @tentative-return-type */
485    public function getDeclaringClass(): ReflectionClass {}
486
487    /** @tentative-return-type */
488    public function getDocComment(): string|false {}
489
490    /** @tentative-return-type */
491    public function setAccessible(bool $accessible): void {}
492
493    /** @tentative-return-type */
494    public function getType(): ?ReflectionType {}
495
496    /** @tentative-return-type */
497    public function hasType(): bool {}
498
499    public function hasDefaultValue(): bool {}
500
501    /** @tentative-return-type */
502    public function getDefaultValue(): mixed {}
503
504    public function getAttributes(?string $name = null, int $flags = 0): array {}
505}
506
507/** @not-serializable */
508class ReflectionClassConstant implements Reflector
509{
510    /** @cvalue ZEND_ACC_PUBLIC */
511    public const int IS_PUBLIC = UNKNOWN;
512    /** @cvalue ZEND_ACC_PROTECTED */
513    public const int IS_PROTECTED = UNKNOWN;
514    /** @cvalue ZEND_ACC_PRIVATE */
515    public const int IS_PRIVATE = UNKNOWN;
516    /** @cvalue ZEND_ACC_FINAL */
517    public const int IS_FINAL = UNKNOWN;
518
519    public string $name;
520    public string $class;
521
522    /** @implementation-alias ReflectionClass::__clone */
523    private function __clone(): void {}
524
525    public function __construct(object|string $class, string $constant) {}
526
527    public function __toString(): string {}
528
529    /** @tentative-return-type */
530    public function getName(): string {}
531
532    /** @tentative-return-type */
533    public function getValue(): mixed {}
534
535    /** @tentative-return-type */
536    public function isPublic(): bool {}
537
538    /** @tentative-return-type */
539    public function isPrivate(): bool {}
540
541    /** @tentative-return-type */
542    public function isProtected(): bool {}
543
544    public function isFinal(): bool {}
545
546    /** @tentative-return-type */
547    public function getModifiers(): int {}
548
549    /** @tentative-return-type */
550    public function getDeclaringClass(): ReflectionClass {}
551
552    /** @tentative-return-type */
553    public function getDocComment(): string|false {}
554
555    public function getAttributes(?string $name = null, int $flags = 0): array {}
556
557    public function isEnumCase(): bool {}
558
559    public function isDeprecated(): bool {}
560
561    public function hasType(): bool {}
562
563    public function getType(): ?ReflectionType {}
564}
565
566/** @not-serializable */
567class ReflectionParameter implements Reflector
568{
569    public string $name;
570
571    /** @implementation-alias ReflectionClass::__clone */
572    private function __clone(): void {}
573
574    /** @param string|array|object $function */
575    public function __construct($function, int|string $param) {}
576
577    public function __toString(): string {}
578
579    /** @tentative-return-type */
580    public function getName(): string {}
581
582    /** @tentative-return-type */
583    public function isPassedByReference(): bool {}
584
585    /** @tentative-return-type */
586    public function canBePassedByValue(): bool {}
587
588    /** @tentative-return-type */
589    public function getDeclaringFunction(): ReflectionFunctionAbstract {}
590
591    /** @tentative-return-type */
592    public function getDeclaringClass(): ?ReflectionClass {}
593
594    /**
595     * @tentative-return-type
596     * @deprecated Use ReflectionParameter::getType() instead
597     */
598    public function getClass(): ?ReflectionClass {}
599
600    /** @tentative-return-type */
601    public function hasType(): bool {}
602
603    /** @tentative-return-type */
604    public function getType(): ?ReflectionType {}
605
606    /**
607     * @tentative-return-type
608     * @deprecated Use ReflectionParameter::getType() instead
609     */
610    public function isArray(): bool {}
611
612    /**
613     * @tentative-return-type
614     * @deprecated Use ReflectionParameter::getType() instead
615     */
616    public function isCallable(): bool {}
617
618    /** @tentative-return-type */
619    public function allowsNull(): bool {}
620
621    /** @tentative-return-type */
622    public function getPosition(): int {}
623
624    /** @tentative-return-type */
625    public function isOptional(): bool {}
626
627    /** @tentative-return-type */
628    public function isDefaultValueAvailable(): bool {}
629
630    /** @tentative-return-type */
631    public function getDefaultValue(): mixed {}
632
633    /** @tentative-return-type */
634    public function isDefaultValueConstant(): bool {}
635
636    /** @tentative-return-type */
637    public function getDefaultValueConstantName(): ?string {}
638
639    /** @tentative-return-type */
640    public function isVariadic(): bool {}
641
642    public function isPromoted(): bool {}
643
644    public function getAttributes(?string $name = null, int $flags = 0): array {}
645}
646
647/** @not-serializable */
648abstract class ReflectionType implements Stringable
649{
650    /** @implementation-alias ReflectionClass::__clone */
651    private function __clone(): void {}
652
653    /** @tentative-return-type */
654    public function allowsNull(): bool {}
655
656    public function __toString(): string {}
657}
658
659class ReflectionNamedType extends ReflectionType
660{
661    /** @tentative-return-type */
662    public function getName(): string {}
663
664    /** @tentative-return-type */
665    public function isBuiltin(): bool {}
666}
667
668class ReflectionUnionType extends ReflectionType
669{
670    public function getTypes(): array {}
671}
672
673class ReflectionIntersectionType extends ReflectionType
674{
675    public function getTypes(): array {}
676}
677
678/** @not-serializable */
679class ReflectionExtension implements Reflector
680{
681    public string $name;
682
683    /** @implementation-alias ReflectionClass::__clone */
684    private function __clone(): void {}
685
686    public function __construct(string $name) {}
687
688    public function __toString(): string {}
689
690    /** @tentative-return-type */
691    public function getName(): string {}
692
693    /** @tentative-return-type */
694    public function getVersion(): ?string {}
695
696    /** @tentative-return-type */
697    public function getFunctions(): array {}
698
699    /** @tentative-return-type */
700    public function getConstants(): array {}
701
702    /** @tentative-return-type */
703    public function getINIEntries(): array {}
704
705    /** @tentative-return-type */
706    public function getClasses(): array {}
707
708    /** @tentative-return-type */
709    public function getClassNames(): array {}
710
711    /** @tentative-return-type */
712    public function getDependencies(): array {}
713
714    /** @tentative-return-type */
715    public function info(): void {}
716
717    /** @tentative-return-type */
718    public function isPersistent(): bool {}
719
720    /** @tentative-return-type */
721    public function isTemporary(): bool {}
722}
723
724/** @not-serializable */
725class ReflectionZendExtension implements Reflector
726{
727    public string $name;
728
729    /** @implementation-alias ReflectionClass::__clone */
730    private function __clone(): void {}
731
732    public function __construct(string $name) {}
733
734    public function __toString(): string {}
735
736    /** @tentative-return-type */
737    public function getName(): string {}
738
739    /** @tentative-return-type */
740    public function getVersion(): string {}
741
742    /** @tentative-return-type */
743    public function getAuthor(): string {}
744
745    /** @tentative-return-type */
746    public function getURL(): string {}
747
748    /** @tentative-return-type */
749    public function getCopyright(): string {}
750}
751
752/** @not-serializable */
753final class ReflectionReference
754{
755    public static function fromArrayElement(array $array, int|string $key): ?ReflectionReference {}
756
757    public function getId(): string {}
758
759    /** @implementation-alias ReflectionClass::__clone */
760    private function __clone(): void {}
761
762    private function __construct() {}
763}
764
765/** @not-serializable */
766class ReflectionAttribute implements Reflector
767{
768    /** @cvalue REFLECTION_ATTRIBUTE_IS_INSTANCEOF */
769    public const int IS_INSTANCEOF = UNKNOWN;
770
771    public string $name;
772
773    public function getName(): string {}
774    public function getTarget(): int {}
775    public function isRepeated(): bool {}
776    public function getArguments(): array {}
777    public function newInstance(): object {}
778
779    public function __toString(): string {}
780
781    private function __clone(): void {}
782
783    private function __construct() {}
784}
785
786class ReflectionEnum extends ReflectionClass
787{
788    public function __construct(object|string $objectOrClass) {}
789
790    public function hasCase(string $name): bool {}
791
792    public function getCase(string $name): ReflectionEnumUnitCase {}
793
794    public function getCases(): array {}
795
796    public function isBacked(): bool {}
797
798    public function getBackingType(): ?ReflectionNamedType {}
799}
800
801class ReflectionEnumUnitCase extends ReflectionClassConstant
802{
803    public function __construct(object|string $class, string $constant) {}
804
805    public function getEnum(): ReflectionEnum {}
806
807    /** @implementation-alias ReflectionClassConstant::getValue */
808    public function getValue(): UnitEnum {}
809}
810
811class ReflectionEnumBackedCase extends ReflectionEnumUnitCase
812{
813    public function __construct(object|string $class, string $constant) {}
814
815    public function getBackingValue(): int|string {}
816}
817
818/** @not-serializable */
819final class ReflectionFiber
820{
821    public function __construct(Fiber $fiber) {}
822
823    public function getFiber(): Fiber {}
824
825    public function getExecutingFile(): ?string {}
826
827    public function getExecutingLine(): ?int {}
828
829    public function getCallable(): callable {}
830
831    public function getTrace(int $options = DEBUG_BACKTRACE_PROVIDE_OBJECT): array {}
832}
833
834/**
835 * @strict-properties
836 * @not-serializable
837 */
838final class ReflectionConstant implements Reflector
839{
840    public string $name;
841
842    public function __construct(string $name) {}
843
844    public function getName(): string {}
845
846    public function getNamespaceName(): string {}
847
848    public function getShortName(): string {}
849
850    public function getValue(): mixed {}
851
852    public function isDeprecated(): bool {}
853
854    public function __toString(): string {}
855}
856