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 231d3f7

Browse files
paranoiqondrejmirtes
authored andcommitted
Mark all result methods in AbstractQuery as impure
1 parent 25ab1ec commit 231d3f7

File tree

1 file changed

+63
-8
lines changed

1 file changed

+63
-8
lines changed

‎stubs/ORM/AbstractQuery.stub‎

Lines changed: 63 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ namespace Doctrine\ORM;
44

55
use Doctrine\Common\Collections\ArrayCollection;
66
use Doctrine\ORM\NonUniqueResultException;
7+
use Doctrine\ORM\NoResultException;
78

89
/**
910
* @template-covariant TKey The type of column used in indexBy
@@ -12,21 +13,75 @@ use Doctrine\ORM\NonUniqueResultException;
1213
abstract class AbstractQuery
1314
{
1415

16+
public const HYDRATE_OBJECT = 1;
17+
1518
/**
1619
* @param ArrayCollection<array-key, mixed>|array<mixed> $parameters
1720
* @return static
1821
*/
1922
public function setParameters($parameters)
2023
{
21-
2224
}
2325

24-
/**
25-
* @return bool|float|int|string|null
26-
*
27-
* @throws NoResultException
28-
* @throws NonUniqueResultException
29-
*/
30-
public function getSingleScalarResult();
26+
/**
27+
* @phpstan-impure
28+
* @param string|AbstractQuery::HYDRATE_* $hydrationMode
29+
*/
30+
public function getResult($hydrationMode = self::HYDRATE_OBJECT): mixed
31+
{
32+
}
33+
34+
/**
35+
* @phpstan-impure
36+
* @return mixed[]
37+
*/
38+
public function getArrayResult(): array
39+
{
40+
}
41+
42+
/**
43+
* @phpstan-impure
44+
* @return mixed[]
45+
*/
46+
public function getSingleColumnResult(): array
47+
{
48+
}
49+
50+
/**
51+
* @phpstan-impure
52+
* @return mixed[]
53+
*/
54+
public function getScalarResult(): array
55+
{
56+
}
57+
58+
/**
59+
* @phpstan-impure
60+
* @param string|AbstractQuery::HYDRATE_*|null $hydrationMode
61+
* @throws NonUniqueResultException
62+
*/
63+
public function getOneOrNullResult($hydrationMode = null): mixed
64+
{
65+
}
66+
67+
/**
68+
* @phpstan-impure
69+
* @param string|AbstractQuery::HYDRATE_*|null $hydrationMode
70+
* @throws NonUniqueResultException
71+
* @throws NoResultException
72+
*/
73+
public function getSingleResult($hydrationMode = null): mixed
74+
{
75+
}
76+
77+
/**
78+
* @phpstan-impure
79+
* @return bool|float|int|string|null
80+
* @throws NoResultException
81+
* @throws NonUniqueResultException
82+
*/
83+
public function getSingleScalarResult()
84+
{
85+
}
3186

3287
}

0 commit comments

Comments
(0)

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