1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 05:41:20 +01:00

Merge pull request #8592 from gphargreaves/#7810/improve-reflection-stubs

#7810/improve reflection stubs
This commit is contained in:
orklah 2022-10-18 00:09:06 +02:00 committed by GitHub
commit e8e8777561
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 0 deletions

View File

@ -57,6 +57,8 @@ class ReflectionClassConstant
class Attribute
{
public int $flags;
public const TARGET_CLASS = 1;
public const TARGET_FUNCTION = 2;
public const TARGET_METHOD = 4;

View File

@ -88,6 +88,21 @@ class ReflectionProperty implements Reflector
* @psalm-mutation-free
*/
public function getType() : ?ReflectionType {}
/**
* @since 8.0
*/
public function hasDefaultValue(): bool {}
/**
* @since 8.0
*/
public function isPromoted(): bool {}
/**
* @since 8.1
*/
public function isReadOnly(): bool {}
}
class ReflectionMethod implements Reflector
@ -132,6 +147,11 @@ class ReflectionParameter implements Reflector {
* @return ($name is null ? array<ReflectionAttribute<object>> : array<ReflectionAttribute<TClass>>)
*/
public function getAttributes(?string $name = null, int $flags = 0): array {}
/**
* @since 8.0
*/
public function isPromoted(): bool {}
}
/**