Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f36d43f

Browse files
Merge remote-tracking branch 'origin/1.5.x' into 2.0.x
2 parents e26fd3c + f61f963 commit f36d43f

File tree

3 files changed

+96
-0
lines changed

3 files changed

+96
-0
lines changed

‎stubs/Collections/ReadableCollection.stub‎

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Doctrine\Common\Collections;
44

5+
use Closure;
56
use Countable;
67
use IteratorAggregate;
78

@@ -13,4 +14,73 @@ use IteratorAggregate;
1314
interface ReadableCollection extends Countable, IteratorAggregate
1415
{
1516

17+
/**
18+
* @param-immediately-invoked-callable $p
19+
*
20+
* @param Closure(TKey, T):bool $p
21+
*
22+
* @return bool
23+
*/
24+
public function exists(Closure $p);
25+
26+
/**
27+
* @param-immediately-invoked-callable $p
28+
*
29+
* @param Closure(T, TKey):bool $p
30+
*
31+
* @return ReadableCollection<TKey, T>
32+
*/
33+
public function filter(Closure $p);
34+
35+
/**
36+
* @param-immediately-invoked-callable $func
37+
*
38+
* @param Closure(T):U $func
39+
*
40+
* @return ReadableCollection<TKey, U>
41+
*
42+
* @template U
43+
*/
44+
public function map(Closure $func);
45+
46+
/**
47+
* @param-immediately-invoked-callable $p
48+
*
49+
* @param Closure(TKey, T):bool $p
50+
*
51+
* @return array{0: ReadableCollection<TKey, T>, 1: ReadableCollection<TKey, T>}
52+
*/
53+
public function partition(Closure $p);
54+
55+
/**
56+
* @param-immediately-invoked-callable $p
57+
*
58+
* @param Closure(TKey, T):bool $p
59+
*
60+
* @return bool TRUE, if the predicate yields TRUE for all elements, FALSE otherwise.
61+
*/
62+
public function forAll(Closure $p);
63+
64+
/**
65+
* @param-immediately-invoked-callable $p
66+
*
67+
* @param Closure(TKey, T):bool $p
68+
*
69+
* @return T|null
70+
*/
71+
public function findFirst(Closure $p);
72+
73+
/**
74+
* @param-immediately-invoked-callable $func
75+
*
76+
* @param Closure(TReturn|TInitial, T):TReturn $func
77+
* @param TInitial $initial
78+
*
79+
* @return TReturn|TInitial
80+
*
81+
* @template TReturn
82+
* @template TInitial
83+
*/
84+
public function reduce(Closure $func, mixed $initial = null);
85+
1686
}

‎stubs/DBAL/Connection.stub‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
namespace Doctrine\DBAL;
44

5+
use Closure;
56
use Doctrine\DBAL\Cache\CacheException;
67
use Doctrine\DBAL\Cache\QueryCacheProfile;
78
use Doctrine\DBAL\Types\Type;
9+
use Throwable;
810

911
class Connection
1012
{
@@ -61,4 +63,15 @@ class Connection
6163
*/
6264
public function executeCacheQuery($sql, $params, $types, QueryCacheProfile $qcp): Result;
6365

66+
/**
67+
* @param-immediately-invoked-callable $func
68+
* @param Closure(self): T $func
69+
* @return T
70+
*
71+
* @template T
72+
*
73+
* @throws Throwable
74+
*/
75+
public function transactional(Closure $func);
76+
6477
}

‎stubs/DBAL/Connection4.stub‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
namespace Doctrine\DBAL;
44

5+
use Closure;
56
use Doctrine\DBAL\Cache\CacheException;
67
use Doctrine\DBAL\Cache\QueryCacheProfile;
78
use Doctrine\DBAL\Types\Type;
9+
use Throwable;
810

911
/**
1012
* @phpstan-type WrapperParameterType = string|Type|ParameterType|ArrayParameterType
@@ -65,4 +67,15 @@ class Connection
6567
*/
6668
public function executeCacheQuery($sql, $params, $types, QueryCacheProfile $qcp): Result;
6769

70+
/**
71+
* @param-immediately-invoked-callable $func
72+
* @param Closure(self): T $func
73+
* @return T
74+
*
75+
* @template T
76+
*
77+
* @throws Throwable
78+
*/
79+
public function transactional(Closure $func);
80+
6881
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /