test.stub.php 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <?php
  2. /** @generate-class-entries static */
  3. namespace {
  4. interface _ZendTestInterface
  5. {
  6. }
  7. /** @alias _ZendTestClassAlias */
  8. class _ZendTestClass implements _ZendTestInterface {
  9. /** @var mixed */
  10. public static $_StaticProp;
  11. public static int $staticIntProp = 123;
  12. public int $intProp = 123;
  13. public ?stdClass $classProp = null;
  14. public stdClass|Iterator|null $classUnionProp = null;
  15. public readonly int $readonlyProp;
  16. public static function is_object(): int {}
  17. /**
  18. * @deprecated
  19. * @return string
  20. */
  21. public function __toString() {}
  22. public function returnsStatic(): static {}
  23. public function returnsThrowable(): Throwable {}
  24. }
  25. class _ZendTestChildClass extends _ZendTestClass
  26. {
  27. public function returnsThrowable(): Exception {}
  28. }
  29. trait _ZendTestTrait {
  30. /** @var mixed */
  31. public $testProp;
  32. public function testMethod(): bool {}
  33. }
  34. final class ZendTestAttribute {
  35. }
  36. final class ZendTestParameterAttribute {
  37. public string $parameter;
  38. public function __construct(string $parameter) {}
  39. }
  40. class ZendTestClassWithMethodWithParameterAttribute {
  41. final public function no_override(string $parameter): int {}
  42. public function override(string $parameter): int {}
  43. }
  44. class ZendTestChildClassWithMethodWithParameterAttribute extends ZendTestClassWithMethodWithParameterAttribute {
  45. public function override(string $parameter): int {}
  46. }
  47. enum ZendTestUnitEnum {
  48. case Foo;
  49. case Bar;
  50. }
  51. enum ZendTestStringEnum: string {
  52. case Foo = "Test1";
  53. case Bar = "Test2";
  54. case Baz = "Test2\\a";
  55. case FortyTwo = "42";
  56. }
  57. function zend_test_array_return(): array {}
  58. function zend_test_nullable_array_return(): ?array {}
  59. function zend_test_void_return(): void {}
  60. /** @deprecated */
  61. function zend_test_deprecated(mixed $arg = null): void {}
  62. function zend_create_unterminated_string(string $str): string {}
  63. function zend_terminate_string(string &$str): void {}
  64. function zend_leak_variable(mixed $variable): void {}
  65. function zend_leak_bytes(int $bytes = 3): void {}
  66. function zend_string_or_object(object|string $param): object|string {}
  67. function zend_string_or_object_or_null(object|string|null $param): object|string|null {}
  68. /** @param stdClass|string $param */
  69. function zend_string_or_stdclass($param): stdClass|string {}
  70. /** @param stdClass|string|null $param */
  71. function zend_string_or_stdclass_or_null($param): stdClass|string|null {}
  72. function zend_iterable(iterable $arg1, ?iterable $arg2 = null): void {}
  73. function zend_weakmap_attach(object $object, mixed $value): bool {}
  74. function zend_weakmap_remove(object $object): bool {}
  75. function zend_weakmap_dump(): array {}
  76. function zend_get_unit_enum(): ZendTestUnitEnum {}
  77. function zend_test_parameter_with_attribute(string $parameter): int {}
  78. function zend_get_current_func_name(): string {}
  79. function zend_call_method(string $class, string $method, mixed $arg1 = UNKNOWN, mixed $arg2 = UNKNOWN): mixed {}
  80. }
  81. namespace ZendTestNS {
  82. class Foo {
  83. public function method(): void {}
  84. }
  85. }
  86. namespace ZendTestNS2 {
  87. class Foo {
  88. public ZendSubNS\Foo $foo;
  89. public function method(): void {}
  90. }
  91. }
  92. namespace ZendTestNS2\ZendSubNS {
  93. class Foo {
  94. public function method(): void {}
  95. }
  96. function namespaced_func(): bool {}
  97. }