Skip to content

Commit

Permalink
[PHPStan 2.1.3] Add ReflectionAttribute and ReflectionIntersectionTyp…
Browse files Browse the repository at this point in the history
…e stub for PHPStan 2.1.3 (#6723)
  • Loading branch information
samsonasik authored Feb 8, 2025
1 parent 59d4bca commit 70920b2
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions build/target-repository/stubs-rector/Internal/NativeClasses.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,42 @@ public function getTypes()
}
}

if (PHP_VERSION_ID < 80000 && ! class_exists('ReflectionAttribute', false)) {
class ReflectionAttribute
{

public const IS_INSTANCEOF = 2;

public function getName(): string
{
}

public function getTarget(): int
{
}

public function isRepeated(): bool
{
}

public function getArguments(): array
{
}

public function newInstance(): object
{
}

private function __clone()
{
}

private function __construct()
{
}
}
}

if (PHP_VERSION_ID < 80000 && ! class_exists('Attribute', false)) {
#[Attribute(Attribute::TARGET_CLASS)]
class Attribute
Expand Down Expand Up @@ -78,3 +114,16 @@ final class ReturnTypeWillChange
{
}
}

if (PHP_VERSION_ID < 80100 && ! class_exists('ReflectionIntersectionType', false)) {
class ReflectionIntersectionType extends ReflectionType
{

/** @return ReflectionType[] */
public function getTypes()
{
return [];
}

}
}

0 comments on commit 70920b2

Please sign in to comment.