From 765179c4c9674211b8918cdb08c8a9f5f917a5de Mon Sep 17 00:00:00 2001 From: Ondrej Mirtes Date: Sat, 17 Aug 2019 13:44:08 +0200 Subject: [PATCH] PhpMethodReflection - fixed isDeprecated(), isInternal(), isFinal() --- src/Reflection/Php/BuiltinMethodReflection.php | 4 ++++ src/Reflection/Php/FakeBuiltinMethodReflection.php | 10 ++++++++++ src/Reflection/Php/NativeBuiltinMethodReflection.php | 10 ++++++++++ src/Reflection/Php/PhpMethodReflection.php | 6 +++--- 4 files changed, 27 insertions(+), 3 deletions(-) diff --git a/src/Reflection/Php/BuiltinMethodReflection.php b/src/Reflection/Php/BuiltinMethodReflection.php index 2cc301d572..8a6226e487 100644 --- a/src/Reflection/Php/BuiltinMethodReflection.php +++ b/src/Reflection/Php/BuiltinMethodReflection.php @@ -48,4 +48,8 @@ public function getReturnType(): ?\ReflectionType; */ public function getParameters(): array; + public function isFinal(): bool; + + public function isInternal(): bool; + } diff --git a/src/Reflection/Php/FakeBuiltinMethodReflection.php b/src/Reflection/Php/FakeBuiltinMethodReflection.php index baba0392ec..16c746840a 100644 --- a/src/Reflection/Php/FakeBuiltinMethodReflection.php +++ b/src/Reflection/Php/FakeBuiltinMethodReflection.php @@ -92,6 +92,16 @@ public function isVariadic(): bool return false; } + public function isFinal(): bool + { + return false; + } + + public function isInternal(): bool + { + return false; + } + public function getReturnType(): ?\ReflectionType { return null; diff --git a/src/Reflection/Php/NativeBuiltinMethodReflection.php b/src/Reflection/Php/NativeBuiltinMethodReflection.php index 92b4684f89..52d3eba0d7 100644 --- a/src/Reflection/Php/NativeBuiltinMethodReflection.php +++ b/src/Reflection/Php/NativeBuiltinMethodReflection.php @@ -80,6 +80,16 @@ public function isDeprecated(): bool return $this->reflection->isDeprecated(); } + public function isFinal(): bool + { + return $this->reflection->isFinal(); + } + + public function isInternal(): bool + { + return $this->reflection->isInternal(); + } + public function isVariadic(): bool { return $this->reflection->isVariadic(); diff --git a/src/Reflection/Php/PhpMethodReflection.php b/src/Reflection/Php/PhpMethodReflection.php index e5ebf875c6..b086a0cecd 100644 --- a/src/Reflection/Php/PhpMethodReflection.php +++ b/src/Reflection/Php/PhpMethodReflection.php @@ -409,17 +409,17 @@ public function getDeprecatedDescription(): ?string public function isDeprecated(): bool { - return $this->isDeprecated; + return $this->reflection->isDeprecated() || $this->isDeprecated; } public function isInternal(): bool { - return $this->isInternal; + return $this->reflection->isInternal() || $this->isInternal; } public function isFinal(): bool { - return $this->isFinal; + return $this->reflection->isFinal() || $this->isFinal; } public function getThrowType(): ?Type