Skip to content

Commit 25f1cd2

Browse files
committed
Attempt to fix PHP 8.0 build issue
1 parent 3dadbba commit 25f1cd2

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/Reflection/ClassReflection.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
use PHPStan\Type\TypeAlias;
5353
use PHPStan\Type\TypehintHelper;
5454
use PHPStan\Type\VerbosityLevel;
55+
use ReflectionClass as CoreReflectionClass;
5556
use ReflectionException;
5657
use function array_diff;
5758
use function array_filter;
@@ -162,6 +163,9 @@ final class ClassReflection
162163
/** @var array<string, bool> */
163164
private array $hasStaticPropertyCache = [];
164165

166+
/**
167+
* @param ReflectionClass|ReflectionEnum $reflection
168+
*/
165169
public function __construct(
166170
private ClassReflectionFactory $classReflectionFactory,
167171
private ReflectionProvider $reflectionProvider,
@@ -175,7 +179,7 @@ public function __construct(
175179
private AttributeReflectionFactory $attributeReflectionFactory,
176180
private ClassReflectionExtensionRegistryProvider $classReflectionExtensionRegistryProvider,
177181
private string $displayName,
178-
private ReflectionClass|ReflectionEnum $reflection,
182+
private CoreReflectionClass $reflection,
179183
private ?string $anonymousFilename,
180184
private ?TemplateTypeMap $resolvedTemplateTypeMap,
181185
private ?ResolvedPhpDocBlock $stubPhpDocBlock,

src/Reflection/ClassReflectionFactory.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,17 @@
77
use PHPStan\PhpDoc\ResolvedPhpDocBlock;
88
use PHPStan\Type\Generic\TemplateTypeMap;
99
use PHPStan\Type\Generic\TemplateTypeVarianceMap;
10+
use ReflectionClass as CoreReflectionClass;
1011

1112
interface ClassReflectionFactory
1213
{
1314

15+
/**
16+
* @param ReflectionClass|ReflectionEnum $reflection
17+
*/
1418
public function create(
1519
string $displayName,
16-
ReflectionClass|ReflectionEnum $reflection,
20+
CoreReflectionClass $reflection,
1721
?string $anonymousFilename,
1822
?TemplateTypeMap $resolvedTemplateTypeMap,
1923
?ResolvedPhpDocBlock $stubPhpDocBlock,

0 commit comments

Comments
 (0)