Skip to content

Commit b8598af

Browse files
committed
Code review
1 parent 82659c2 commit b8598af

File tree

5 files changed

+19
-22
lines changed

5 files changed

+19
-22
lines changed

ext/spl/spl_array.stub.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,28 +96,28 @@ class ArrayIterator implements SeekableIterator, ArrayAccess, Serializable, Coun
9696
public function __construct(array|object $array = [], int $flags = 0) {}
9797

9898
/**
99-
* @param array|string|float|int|bool|null $index
99+
* @param string|int $index
100100
* @return bool
101101
* @alias ArrayObject::offsetExists
102102
*/
103103
public function offsetExists($index) {}
104104

105105
/**
106-
* @param array|string|float|int|bool|null $index
106+
* @param string|int $index
107107
* @return mixed
108108
* @alias ArrayObject::offsetGet
109109
*/
110110
public function offsetGet($index) {}
111111

112112
/**
113-
* @param array|string|float|int|bool|null $index
113+
* @param string|int $index
114114
* @return void
115115
* @alias ArrayObject::offsetSet
116116
*/
117117
public function offsetSet($index, mixed $value) {}
118118

119119
/**
120-
* @param array|string|float|int|bool|null $index
120+
* @param string|int $index
121121
* @return void
122122
* @alias ArrayObject::offsetUnset
123123
*/

ext/spl/spl_array_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: 93e4c96c631badd30f847fb24636cb881563a949 */
2+
* Stub hash: bedd13338707177e28a021722df64be2f74a7945 */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ArrayObject___construct, 0, 0, 0)
55
ZEND_ARG_TYPE_MASK(0, input, MAY_BE_ARRAY|MAY_BE_OBJECT, "[]")

ext/spl/spl_dllist.c

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -758,8 +758,7 @@ PHP_METHOD(SplDoublyLinkedList, offsetGet)
758758
RETURN_THROWS();
759759
}
760760

761-
zval *value = &element->data;
762-
ZVAL_COPY_DEREF(return_value, value);
761+
ZVAL_COPY_DEREF(return_value, &element->data);
763762
} /* }}} */
764763

765764
/* {{{ Sets the value at the specified $index to $newval. */
@@ -770,10 +769,9 @@ PHP_METHOD(SplDoublyLinkedList, offsetSet)
770769
zval *value;
771770
spl_dllist_object *intern;
772771

773-
ZEND_PARSE_PARAMETERS_START(2, 2)
774-
Z_PARAM_LONG_OR_NULL(index, index_is_null)
775-
Z_PARAM_ZVAL(value)
776-
ZEND_PARSE_PARAMETERS_END();
772+
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l!z", &index, &index_is_null, &value) == FAILURE) {
773+
RETURN_THROWS();
774+
}
777775

778776
intern = Z_SPLDLLIST_P(ZEND_THIS);
779777

@@ -1066,9 +1064,7 @@ PHP_METHOD(SplDoublyLinkedList, current)
10661064
if (element == NULL || Z_ISUNDEF(element->data)) {
10671065
RETURN_NULL();
10681066
} else {
1069-
zval *value = &element->data;
1070-
1071-
ZVAL_COPY_DEREF(return_value, value);
1067+
ZVAL_COPY_DEREF(return_value, &element->data);
10721068
}
10731069
}
10741070
/* }}} */

ext/spl/spl_fixedarray.stub.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,11 @@ public function getSize() {}
2424
/** @return bool */
2525
public function setSize(int $size) {}
2626

27-
/** @return bool */
28-
public function offsetExists(mixed $index) {}
27+
/**
28+
* @param int $index
29+
* @return bool
30+
*/
31+
public function offsetExists($index) {}
2932

3033
/**
3134
* @param int $index

ext/spl/spl_fixedarray_arginfo.h

Lines changed: 4 additions & 6 deletions
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: 90b8a23bd4968039522f0b8a6c2034a3784fe78a */
2+
* Stub hash: 4b6c37c54416ee46f610baba2a8b2be45d1db96f */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SplFixedArray___construct, 0, 0, 0)
55
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, size, IS_LONG, 0, "0")
@@ -24,19 +24,17 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SplFixedArray_setSize, 0, 0, 1)
2424
ZEND_END_ARG_INFO()
2525

2626
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SplFixedArray_offsetExists, 0, 0, 1)
27-
ZEND_ARG_TYPE_INFO(0, index, IS_MIXED, 0)
28-
ZEND_END_ARG_INFO()
29-
30-
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SplFixedArray_offsetGet, 0, 0, 1)
3127
ZEND_ARG_INFO(0, index)
3228
ZEND_END_ARG_INFO()
3329

30+
#define arginfo_class_SplFixedArray_offsetGet arginfo_class_SplFixedArray_offsetExists
31+
3432
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SplFixedArray_offsetSet, 0, 0, 2)
3533
ZEND_ARG_INFO(0, index)
3634
ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0)
3735
ZEND_END_ARG_INFO()
3836

39-
#define arginfo_class_SplFixedArray_offsetUnset arginfo_class_SplFixedArray_offsetGet
37+
#define arginfo_class_SplFixedArray_offsetUnset arginfo_class_SplFixedArray_offsetExists
4038

4139
#define arginfo_class_SplFixedArray_rewind arginfo_class_SplFixedArray___wakeup
4240

0 commit comments

Comments
 (0)