spl_heap.stub.php 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <?php
  2. /** @generate-class-entries */
  3. class SplPriorityQueue implements Iterator, Countable
  4. {
  5. /** @tentative-return-type */
  6. public function compare(mixed $priority1, mixed $priority2): int {}
  7. /** @return bool */
  8. public function insert(mixed $value, mixed $priority) {} // TODO make return type void
  9. /** @tentative-return-type */
  10. public function setExtractFlags(int $flags): int {}
  11. /** @tentative-return-type */
  12. public function top(): mixed {}
  13. /** @tentative-return-type */
  14. public function extract(): mixed {}
  15. /**
  16. * @tentative-return-type
  17. * @implementation-alias SplHeap::count
  18. */
  19. public function count(): int {}
  20. /**
  21. * @tentative-return-type
  22. * @implementation-alias SplHeap::isEmpty
  23. */
  24. public function isEmpty(): bool {}
  25. /**
  26. * @tentative-return-type
  27. * @implementation-alias SplHeap::rewind
  28. */
  29. public function rewind(): void {}
  30. /** @tentative-return-type */
  31. public function current(): mixed {}
  32. /**
  33. * @tentative-return-type
  34. * @implementation-alias SplHeap::key
  35. */
  36. public function key(): int {}
  37. /**
  38. * @tentative-return-type
  39. * @implementation-alias SplHeap::next
  40. */
  41. public function next(): void {}
  42. /**
  43. * @tentative-return-type
  44. * @implementation-alias SplHeap::valid
  45. */
  46. public function valid(): bool {}
  47. /**
  48. * @return bool
  49. * @implementation-alias SplHeap::recoverFromCorruption
  50. */
  51. public function recoverFromCorruption() {} // TODO make return type void
  52. /**
  53. * @tentative-return-type
  54. * @implementation-alias SplHeap::isCorrupted
  55. */
  56. public function isCorrupted(): bool {}
  57. /** @tentative-return-type */
  58. public function getExtractFlags(): int {}
  59. /** @tentative-return-type */
  60. public function __debugInfo(): array {}
  61. }
  62. abstract class SplHeap implements Iterator, Countable
  63. {
  64. /** @tentative-return-type */
  65. public function extract(): mixed {}
  66. /** @tentative-return-type */
  67. public function insert(mixed $value): bool {}
  68. /** @tentative-return-type */
  69. public function top(): mixed {}
  70. /** @tentative-return-type */
  71. public function count(): int {}
  72. /** @tentative-return-type */
  73. public function isEmpty(): bool {}
  74. /** @tentative-return-type */
  75. public function rewind(): void {}
  76. /** @tentative-return-type */
  77. public function current(): mixed {}
  78. /** @tentative-return-type */
  79. public function key(): int {}
  80. /** @tentative-return-type */
  81. public function next(): void {}
  82. /** @tentative-return-type */
  83. public function valid(): bool {}
  84. /** @tentative-return-type */
  85. public function recoverFromCorruption(): bool {}
  86. /** @tentative-return-type */
  87. abstract protected function compare(mixed $value1, mixed $value2): int;
  88. /** @tentative-return-type */
  89. public function isCorrupted(): bool {}
  90. /** @tentative-return-type */
  91. public function __debugInfo(): array {}
  92. }
  93. class SplMinHeap extends SplHeap
  94. {
  95. /** @tentative-return-type */
  96. protected function compare(mixed $value1, mixed $value2): int {}
  97. }
  98. class SplMaxHeap extends SplHeap
  99. {
  100. /** @tentative-return-type */
  101. protected function compare(mixed $value1, mixed $value2): int {}
  102. }