diff --git a/src/PhpDoc/ResolvedPhpDocBlock.php b/src/PhpDoc/ResolvedPhpDocBlock.php index 38350d4cf4..c797e8ecb5 100644 --- a/src/PhpDoc/ResolvedPhpDocBlock.php +++ b/src/PhpDoc/ResolvedPhpDocBlock.php @@ -188,7 +188,7 @@ public function merge(array $parents, array $parentPhpDocBlocks): self $result->mixinTags = $this->getMixinTags(); $result->typeAliasTags = $this->getTypeAliasTags(); $result->typeAliasImportTags = $this->getTypeAliasImportTags(); - $result->deprecatedTag = self::mergeDeprecatedTags($this->getDeprecatedTag(), $parents); + $result->deprecatedTag = $this->getDeprecatedTag(); $result->isDeprecated = $result->deprecatedTag !== null; $result->isInternal = $this->isInternal(); $result->isFinal = $this->isFinal(); @@ -632,25 +632,6 @@ private static function mergeOneParentReturnTag(?ReturnTag $returnTag, self $par return self::resolveTemplateTypeInTag($parentReturnTag->toImplicit(), $phpDocBlock); } - /** - * @param array $parents - */ - private static function mergeDeprecatedTags(?DeprecatedTag $deprecatedTag, array $parents): ?DeprecatedTag - { - if ($deprecatedTag !== null) { - return $deprecatedTag; - } - foreach ($parents as $parent) { - $result = $parent->getDeprecatedTag(); - if ($result === null) { - continue; - } - return $result; - } - - return null; - } - /** * @param array $parents */ diff --git a/tests/PHPStan/Reflection/Annotations/DeprecatedAnnotationsTest.php b/tests/PHPStan/Reflection/Annotations/DeprecatedAnnotationsTest.php index 2d108fb0c9..1142377274 100644 --- a/tests/PHPStan/Reflection/Annotations/DeprecatedAnnotationsTest.php +++ b/tests/PHPStan/Reflection/Annotations/DeprecatedAnnotationsTest.php @@ -138,7 +138,7 @@ public function testDeprecatedMethodsFromInterface(): void { $reflectionProvider = $this->createReflectionProvider(); $class = $reflectionProvider->getClass(DeprecatedBar::class); - $this->assertTrue($class->getNativeMethod('superDeprecated')->isDeprecated()->yes()); + $this->assertFalse($class->getNativeMethod('superDeprecated')->isDeprecated()->yes()); } }