Skip to content

Commit 72991b1

Browse files
committed
[skip ci] Update stub api documentation
1 parent b4c356b commit 72991b1

File tree

2 files changed

+36
-4
lines changed

2 files changed

+36
-4
lines changed

ext/spl/spl_deque.stub.php

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@
33
/** @generate-class-entries */
44

55
/**
6-
* A double-ended queue represented internally as a circular buffer.
6+
* A double-ended queue (Typically abbreviated as Deque, pronounced "deck", like "cheque")
7+
* represented internally as a circular buffer.
8+
*
79
* This has much lower memory usage than SplDoublyLinkedList or its subclasses (SplStack, SplStack),
810
* and operations are significantly faster than SplDoublyLinkedList.
911
*
12+
* See https://en.wikipedia.org/wiki/Double-ended_queue
13+
*
1014
* This supports amortized constant time pushing and popping onto the front or back of the array.
1115
*
1216
* Naming is based on https://www.php.net/spldoublylinkedlist
@@ -44,9 +48,15 @@ public static function __set_state(array $array): Deque {}
4448
public function push(mixed $value): void {}
4549
/** Prepends a value to the start of the Deque. */
4650
public function unshift(mixed $value): void {}
47-
/** Pops a value from the end of the Deque. */
51+
/**
52+
* Pops a value from the end of the Deque.
53+
* @throws UnderflowException if the Deque is empty
54+
*/
4855
public function pop(): mixed {}
49-
/** Shifts a value from the front of the Deque. */
56+
/**
57+
* Shifts a value from the front of the Deque.
58+
* @throws UnderflowException if the Deque is empty
59+
*/
5060
public function shift(): mixed {}
5161

5262
/** Peeks at the value at the start of the Deque, throws if empty */
@@ -57,13 +67,35 @@ public function top(): mixed {}
5767
/** Returns a list of the elements from front to back. */
5868
public function toArray(): array {}
5969
/* Get and set are strictly typed, unlike offsetGet/offsetSet. */
70+
/**
71+
* Returns the value at offset $offset (relative to the start of the Deque)
72+
* @throws OutOfBoundsException if the value of (int)$offset is not within the bounds of this vector
73+
*/
6074
public function get(int $offset): mixed {}
75+
/**
76+
* Sets the value at offset $offset (relative to the start of the Deque) to $value
77+
* @throws OutOfBoundsException if the value of (int)$offset is not within the bounds of this vector
78+
*/
6179
public function set(int $offset, mixed $value): void {}
6280
// Must be mixed for compatibility with ArrayAccess
81+
/**
82+
* Returns the value at offset (int)$offset (relative to the start of the Deque)
83+
* @throws OutOfBoundsException if the value of (int)$offset is not within the bounds of this vector
84+
*/
6385
public function offsetGet(mixed $offset): mixed {}
86+
/**
87+
* Returns true if `0 <= (int)$offset && (int)$offset < $this->count().
88+
*/
6489
public function offsetExists(mixed $offset): bool {}
90+
/**
91+
* Sets the value at offset $offset (relative to the start of the Deque) to $value
92+
* @throws OutOfBoundsException if the value of (int)$offset is not within the bounds of this vector
93+
*/
6594
public function offsetSet(mixed $offset, mixed $value): void {}
6695
/** Throws unconditionally */
96+
/**
97+
* @throws RuntimeException unconditionally because unset and null are different things, unlike SplFixedArray
98+
*/
6799
public function offsetUnset(mixed $offset): void {}
68100

69101
/** This is JSON serialized as a JSON array with elements from front to back */

ext/spl/spl_deque_arginfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 41b3f16290517e41a55e052b96bbcf8ea65c6e8a */
2+
* Stub hash: d8d7e5ffff1a572ea16142a05b4db08a9898e5b8 */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Deque___construct, 0, 0, 0)
55
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, iterator, IS_ITERABLE, 0, "[]")

0 commit comments

Comments
 (0)