Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f7b498b

Browse files
authored
Use true as return types for SplHeap (#13147)
1 parent 474edd6 commit f7b498b

File tree

3 files changed

+17
-11
lines changed

3 files changed

+17
-11
lines changed

‎UPGRADING‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,12 @@ PDO_SQLITE:
311311
- PGSQL:
312312
. pg_select, the conditions arguments accepts an empty array and is optional.
313313

314+
- SPL:
315+
. SplPriorityQueue::insert() and SplPriorityQueue::recoverFromCorruption()
316+
now has a tentative return type of true
317+
. SplHeap::insert() and SplHeap::recoverFromCorruption()
318+
now has a tentative return type of true instead of bool
319+
314320
- Standard:
315321
. The internal implementation for rounding to integers has been rewritten
316322
to be easier to verify for correctness and to be easier to maintain.

‎ext/spl/spl_heap.stub.php‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ class SplPriorityQueue implements Iterator, Countable
1414
/** @tentative-return-type */
1515
public function compare(mixed $priority1, mixed $priority2): int {}
1616

17-
/** @return true */
18-
public function insert(mixed $value, mixed $priority) {} // TODO make return type void
17+
/** @tentative-return-type */
18+
public function insert(mixed $value, mixed $priority): true {}
1919

2020
/** @tentative-return-type */
2121
public function setExtractFlags(int $flags): int {}
@@ -66,10 +66,10 @@ public function next(): void {}
6666
public function valid(): bool {}
6767

6868
/**
69-
* @return bool
69+
* @tentative-return-type
7070
* @implementation-alias SplHeap::recoverFromCorruption
7171
*/
72-
public function recoverFromCorruption() {} // TODO make return type void
72+
public function recoverFromCorruption(): true {}
7373

7474
/**
7575
* @tentative-return-type
@@ -90,7 +90,7 @@ abstract class SplHeap implements Iterator, Countable
9090
public function extract(): mixed {}
9191

9292
/** @tentative-return-type */
93-
public function insert(mixed $value): bool {}
93+
public function insert(mixed $value): true {}
9494

9595
/** @tentative-return-type */
9696
public function top(): mixed {}
@@ -117,7 +117,7 @@ public function next(): void {}
117117
public function valid(): bool {}
118118

119119
/** @tentative-return-type */
120-
public function recoverFromCorruption(): bool {}
120+
public function recoverFromCorruption(): true {}
121121

122122
/** @tentative-return-type */
123123
abstract protected function compare(mixed $value1, mixed $value2): int;

‎ext/spl/spl_heap_arginfo.h‎

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /