Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#7810/improve reflection stubs #8592

Merged
merged 2 commits into from Oct 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions stubs/Php80.phpstub
Expand Up @@ -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;
Expand Down
20 changes: 20 additions & 0 deletions stubs/Reflection.phpstub
Expand Up @@ -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
Expand Down Expand Up @@ -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 {}
}

/**
Expand Down