Skip to content

Commit 0632865

Browse files
Add SplObjectStorage stub
1 parent bc4ca17 commit 0632865

4 files changed

Lines changed: 70 additions & 4 deletions

File tree

conf/bleedingEdge.neon

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ parameters:
77
fileWhitespace: true
88
unusedClassElements: true
99
readComposerPhpVersion: true
10+
stubFiles:
11+
- ../stubs/SplObjectStorage.stub

stubs/SplObjectStorage.stub

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<?php
2+
3+
/**
4+
* @template TObject of object
5+
* @template TData
6+
*
7+
* @template-implements Iterator<int, TObject>
8+
* @template-implements ArrayAccess<TObject, TData>
9+
*/
10+
class SplObjectStorage implements Countable, Iterator, Serializable, ArrayAccess
11+
{
12+
13+
/**
14+
* @param \SplObjectStorage<TObject, TData> $storage
15+
*/
16+
public function addAll(SplObjectStorage $storage): void { }
17+
18+
/**
19+
* @param TObject $object
20+
* @param TData $data
21+
*/
22+
public function attach(object $object, $data = null): void { }
23+
24+
/**
25+
* @param TObject $object
26+
*/
27+
public function contains(object $object): bool { }
28+
29+
/**
30+
* @param TObject $object
31+
*/
32+
public function detach(object $object): void { }
33+
34+
/**
35+
* @param TObject $object
36+
*/
37+
public function detach(object $object): void { }
38+
39+
/**
40+
* @param TObject $object
41+
*/
42+
public function getHash(object $object): string { }
43+
44+
/**
45+
* @return TData
46+
*/
47+
public function getInfo() { }
48+
49+
/**
50+
* @param \SplObjectStorage<object, mixed> $storage
51+
*/
52+
public function removeAll(SplObjectStorage $storage): void { }
53+
54+
/**
55+
* @param \SplObjectStorage<object, mixed> $storage
56+
*/
57+
public function removeAllExcept(SplObjectStorage $storage): void { }
58+
59+
/**
60+
* @param TData $data
61+
*/
62+
public function setInfo($data): void { }
63+
64+
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[
22
{
3-
"message": "Cannot assign offset int to SplObjectStorage.",
3+
"message": "Cannot assign offset int to SplObjectStorage<object, mixed>.",
44
"line": 35,
55
"ignorable": true
66
}
7-
]
7+
]
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[
22
{
3-
"message": "Cannot assign offset int|object to SplObjectStorage.",
3+
"message": "Cannot assign offset int|object to SplObjectStorage<object, mixed>.",
44
"line": 27,
55
"ignorable": true
66
}
7-
]
7+
]

0 commit comments

Comments
 (0)