-
Notifications
You must be signed in to change notification settings - Fork 102
/
Copy pathCollection.stub
76 lines (66 loc) · 1.4 KB
/
Collection.stub
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
namespace Doctrine\Common\Collections;
use ArrayAccess;
use Closure;
use Countable;
use IteratorAggregate;
/**
* @template TKey of array-key
* @template T
* @extends IteratorAggregate<TKey, T>
* @extends ArrayAccess<TKey, T>
* @extends ReadableCollection<TKey, T>
*/
interface Collection extends Countable, IteratorAggregate, ArrayAccess, ReadableCollection
{
/**
* @phpstan-impure
*
* @param T $element
*
* @return void
*/
public function add($element) {}
/**
* @phpstan-impure
*
* @param TKey $key
*
* @return T|null
*/
public function remove($key) {}
/**
* @phpstan-impure
*
* @param T $element
*
* @return bool
*/
public function removeElement($element) {}
/**
* @param-immediately-invoked-callable $p
*
* @param Closure(T, TKey):bool $p
*
* @return Collection<TKey, T>
*/
public function filter(Closure $p);
/**
* @param-immediately-invoked-callable $func
*
* @param Closure(T):U $func
*
* @return Collection<TKey, U>
*
* @template U
*/
public function map(Closure $func);
/**
* @param-immediately-invoked-callable $p
*
* @param Closure(TKey, T):bool $p
*
* @return array{0: Collection<TKey, T>, 1: Collection<TKey, T>}
*/
public function partition(Closure $p);
}