Skip to content

[depre] Remove DoctrineDocBlockResolver deprecated since 2025-05 - #491

Merged
TomasVotruba merged 1 commit into
mainfrom
remove-doctrine-docblock-resolver
Jul 31, 2026
Merged

[depre] Remove DoctrineDocBlockResolver deprecated since 2025-05#491
TomasVotruba merged 1 commit into
mainfrom
remove-doctrine-docblock-resolver

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

DoctrineDocBlockResolver was deprecated on 2025-05-23 - 14 months ago - in favor of EntityLikeClassDetector. It carries both the docblock tag and a native attribute:

/**
 * @api
 * @deprecated Use \Rector\Doctrine\TypedCollections\NodeAnalyzer\EntityLikeClassDetector instead
 */
final readonly class DoctrineDocBlockResolver
{
    #[Deprecated(message: 'Use ' . EntityLikeClassDetector::class . '::detect() instead')]
    public function isDoctrineEntityClass(Class_ $class): bool

It has no references left anywhere in the repository - src, rules, config or tests.

The single method is a thin wrapper that EntityLikeClassDetector::detect() covers:

return $this->attrinationFinder->hasByMany($class, [
    MappingClass::ENTITY, MappingClass::EMBEDDABLE, OdmMappingClass::DOCUMENT,
]);

Note the class is marked @api, so third-party rules constructing it directly will break. The #[Deprecated] attribute has been raising a native deprecation on every call for 14 months.

PHPStan, ECS and PHPUnit (336 tests) pass on the removal.

The class has been deprecated for 14 months in favor of
EntityLikeClassDetector and has no references left in this repository.
@TomasVotruba
TomasVotruba merged commit 71c6350 into main Jul 31, 2026
7 checks passed
@TomasVotruba
TomasVotruba deleted the remove-doctrine-docblock-resolver branch July 31, 2026 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant