Skip to content

Commit bfca7a9

Browse files
committed
Various ext/spl stub fixes
1 parent a0af84b commit bfca7a9

File tree

3 files changed

+21
-37
lines changed

3 files changed

+21
-37
lines changed

ext/spl/spl_array.stub.php

Lines changed: 12 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,17 @@ class ArrayObject implements IteratorAggregate, ArrayAccess, Serializable, Count
66
{
77
public function __construct(array|object $array = [], int $flags = 0, string $iteratorClass = ArrayIterator::class) {}
88

9-
/**
10-
* @param string|int $key
11-
* @return bool
12-
*/
13-
public function offsetExists($key) {}
9+
/** @return bool */
10+
public function offsetExists(mixed $key) {}
1411

15-
/**
16-
* @param string|int $key
17-
* @return mixed
18-
*/
19-
public function offsetGet($key) {}
12+
/** @return mixed */
13+
public function offsetGet(mixed $key) {}
2014

21-
/**
22-
* @param string|int $key
23-
* @return void
24-
*/
25-
public function offsetSet($key, mixed $value) {}
15+
/** @return void */
16+
public function offsetSet(mixed $key, mixed $value) {}
2617

27-
/**
28-
* @param string|int $key
29-
* @return void
30-
*/
31-
public function offsetUnset($key) {}
18+
/** @return void */
19+
public function offsetUnset(mixed $key) {}
3220

3321
/** @return void */
3422
public function append(mixed $value) {}
@@ -96,32 +84,28 @@ class ArrayIterator implements SeekableIterator, ArrayAccess, Serializable, Coun
9684
public function __construct(array|object $array = [], int $flags = 0) {}
9785

9886
/**
99-
* @param string|int $key
10087
* @return bool
10188
* @implementation-alias ArrayObject::offsetExists
10289
*/
103-
public function offsetExists($key) {}
90+
public function offsetExists(mixed $key) {}
10491

10592
/**
106-
* @param string|int $key
10793
* @return mixed
10894
* @implementation-alias ArrayObject::offsetGet
10995
*/
110-
public function offsetGet($key) {}
96+
public function offsetGet(mixed $key) {}
11197

11298
/**
113-
* @param string|int $key
11499
* @return void
115100
* @implementation-alias ArrayObject::offsetSet
116101
*/
117-
public function offsetSet($key, mixed $value) {}
102+
public function offsetSet(mixed $key, mixed $value) {}
118103

119104
/**
120-
* @param string|int $key
121105
* @return void
122106
* @implementation-alias ArrayObject::offsetUnset
123107
*/
124-
public function offsetUnset($key) {}
108+
public function offsetUnset(mixed $key) {}
125109

126110
/**
127111
* @return void

ext/spl/spl_directory.stub.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ public function fgetcsv(string $separator = ",", string $enclosure = "\"", strin
211211
/** @return int|false */
212212
public function fputcsv(array $fields, string $separator = ",", string $enclosure = "\"", string $escape = "\\") {}
213213

214-
/** @return bool|null */
214+
/** @return void */
215215
public function setCsvControl(string $separator = ",", string $enclosure = "\"", string $escape = "\\") {}
216216

217217
/** @return array */
@@ -274,7 +274,7 @@ public function getMaxLineLen() {}
274274
/** @return bool */
275275
public function hasChildren() {}
276276

277-
/** @return null */
277+
/** @return void */
278278
public function getChildren() {}
279279

280280
/** @return void */

ext/spl/spl_iterators.stub.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function getChildren();
5353

5454
class RecursiveIteratorIterator implements OuterIterator
5555
{
56-
public function __construct(Traversable $iterator, int $mode = self::LEAVES_ONLY, int $flags = 0) {}
56+
public function __construct(Traversable $iterator, int $mode = RecursiveIteratorIterator::LEAVES_ONLY, int $flags = 0) {}
5757

5858
/** @return void */
5959
public function rewind() {}
@@ -200,7 +200,7 @@ public function getPosition() {}
200200

201201
class CachingIterator extends IteratorIterator implements ArrayAccess, Countable
202202
{
203-
public function __construct(Iterator $iterator, int $flags = self::CALL_TOSTRING) {}
203+
public function __construct(Iterator $iterator, int $flags = CachingIterator::CALL_TOSTRING) {}
204204

205205
/** @return void */
206206
public function rewind() {}
@@ -255,7 +255,7 @@ public function count() {}
255255

256256
class RecursiveCachingIterator extends CachingIterator implements RecursiveIterator
257257
{
258-
public function __construct(Iterator $iterator, int $flags = self::CALL_TOSTRING) {}
258+
public function __construct(Iterator $iterator, int $flags = RecursiveCachingIterator::CALL_TOSTRING) {}
259259

260260
/** @return bool */
261261
public function hasChildren() {}
@@ -320,7 +320,7 @@ public function next() {}
320320

321321
class RegexIterator extends FilterIterator
322322
{
323-
public function __construct(Iterator $iterator, string $pattern, int $mode = self::MATCH, int $flags = 0, int $pregFlags = 0) {}
323+
public function __construct(Iterator $iterator, string $pattern, int $mode = RegexIterator::MATCH, int $flags = 0, int $pregFlags = 0) {}
324324

325325
/** @return bool */
326326
public function accept() {}
@@ -349,7 +349,7 @@ public function setPregFlags(int $pregFlags) {}
349349

350350
class RecursiveRegexIterator extends RegexIterator implements RecursiveIterator
351351
{
352-
public function __construct(RecursiveIterator $iterator, string $pattern, int $mode = self::MATCH, int $flags = 0, int $pregFlags = 0) {}
352+
public function __construct(RecursiveIterator $iterator, string $pattern, int $mode = RecursiveRegexIterator::MATCH, int $flags = 0, int $pregFlags = 0) {}
353353

354354
/** @return bool */
355355
public function accept() {}
@@ -369,9 +369,9 @@ class RecursiveTreeIterator extends RecursiveIteratorIterator
369369
/** @param RecursiveIterator|IteratorAggregate $iterator */
370370
public function __construct(
371371
$iterator,
372-
int $flags = self::BYPASS_KEY,
372+
int $flags = RecursiveTreeIterator::BYPASS_KEY,
373373
int $cachingIteratorFlags = CachingIterator::CATCH_GET_CHILD,
374-
int $mode = self::SELF_FIRST
374+
int $mode = RecursiveTreeIterator::SELF_FIRST
375375
) {}
376376

377377
/** @return mixed */

0 commit comments

Comments
 (0)