Skip to content

Revert "Resolve deprecated tag also from parents" #1022

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 1 addition & 20 deletions src/PhpDoc/ResolvedPhpDocBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -632,25 +632,6 @@ private static function mergeOneParentReturnTag(?ReturnTag $returnTag, self $par
return self::resolveTemplateTypeInTag($parentReturnTag->toImplicit(), $phpDocBlock);
}

/**
* @param array<int, self> $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<int, self> $parents
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

}