From ea39a6e6742eaf4c5af6e09dc477068f8af9dba7 Mon Sep 17 00:00:00 2001 From: Greg Hargreaves Date: Mon, 17 Oct 2022 00:33:26 +0100 Subject: [PATCH 1/2] Fixes #7810 --- stubs/Php80.phpstub | 2 ++ stubs/Reflection.phpstub | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/stubs/Php80.phpstub b/stubs/Php80.phpstub index 001ebf17ae6..50d9d78e4be 100644 --- a/stubs/Php80.phpstub +++ b/stubs/Php80.phpstub @@ -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; diff --git a/stubs/Reflection.phpstub b/stubs/Reflection.phpstub index cfbe3ba2375..40dfbe9ba3c 100644 --- a/stubs/Reflection.phpstub +++ b/stubs/Reflection.phpstub @@ -88,6 +88,16 @@ 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 {} } class ReflectionMethod implements Reflector @@ -132,6 +142,11 @@ class ReflectionParameter implements Reflector { * @return ($name is null ? array> : array>) */ public function getAttributes(?string $name = null, int $flags = 0): array {} + + /** + * @since 8.0 + */ + public function isPromoted(): bool {} } /** From 45bb58ebfac386e608af34eb28fe2add99fbce25 Mon Sep 17 00:00:00 2001 From: Greg Hargreaves Date: Mon, 17 Oct 2022 00:46:19 +0100 Subject: [PATCH 2/2] Add stub for reflection property isReadOnly --- stubs/Reflection.phpstub | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/stubs/Reflection.phpstub b/stubs/Reflection.phpstub index 40dfbe9ba3c..08e2a3deaf8 100644 --- a/stubs/Reflection.phpstub +++ b/stubs/Reflection.phpstub @@ -98,6 +98,11 @@ class ReflectionProperty implements Reflector * @since 8.0 */ public function isPromoted(): bool {} + + /** + * @since 8.1 + */ + public function isReadOnly(): bool {} } class ReflectionMethod implements Reflector