Skip to content

Commit 70920b2

Browse files
authored
[PHPStan 2.1.3] Add ReflectionAttribute and ReflectionIntersectionType stub for PHPStan 2.1.3 (#6723)
1 parent 59d4bca commit 70920b2

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

build/target-repository/stubs-rector/Internal/NativeClasses.php

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,42 @@ public function getTypes()
1111
}
1212
}
1313

14+
if (PHP_VERSION_ID < 80000 && ! class_exists('ReflectionAttribute', false)) {
15+
class ReflectionAttribute
16+
{
17+
18+
public const IS_INSTANCEOF = 2;
19+
20+
public function getName(): string
21+
{
22+
}
23+
24+
public function getTarget(): int
25+
{
26+
}
27+
28+
public function isRepeated(): bool
29+
{
30+
}
31+
32+
public function getArguments(): array
33+
{
34+
}
35+
36+
public function newInstance(): object
37+
{
38+
}
39+
40+
private function __clone()
41+
{
42+
}
43+
44+
private function __construct()
45+
{
46+
}
47+
}
48+
}
49+
1450
if (PHP_VERSION_ID < 80000 && ! class_exists('Attribute', false)) {
1551
#[Attribute(Attribute::TARGET_CLASS)]
1652
class Attribute
@@ -78,3 +114,16 @@ final class ReturnTypeWillChange
78114
{
79115
}
80116
}
117+
118+
if (PHP_VERSION_ID < 80100 && ! class_exists('ReflectionIntersectionType', false)) {
119+
class ReflectionIntersectionType extends ReflectionType
120+
{
121+
122+
/** @return ReflectionType[] */
123+
public function getTypes()
124+
{
125+
return [];
126+
}
127+
128+
}
129+
}

0 commit comments

Comments
 (0)