Skip to content

@see is added even though its already added on class #9795

Description

@talha-core

Bug Report

Rector version: 2.5.3

When running rector it adds another @see tag for the class.

Minimal PHP Code Causing Issue

<?php

declare(strict_types=1);

namespace App\Entity;

use App\Repository\StorageTypeRepository;
use App\Tests\Entity\StorageTypeTest;
use Doctrine\ORM\Mapping as ORM;

/**
 * @see StorageTypeTest
 * @see \App\Tests\Entity\StorageTypeTest
 */
#[ORM\Entity(repositoryClass: StorageTypeRepository::class)]
class StorageType
{}
5) src/Entity/StorageType.php:10

    ---------- begin diff ----------
@@ Line 10 @@

 /**
  * @see StorageTypeTest
+ * @see \App\Tests\Entity\StorageTypeTest
  */
 #[ORM\Entity(repositoryClass: StorageTypeRepository::class)]
 class StorageType
    ----------- end diff -----------

Applied rules:
 * AddSeeTestAnnotationRector

rector.php

<?php

declare(strict_types=1);

use Rector\Config\RectorConfig;
use Rector\Set\ValueObject\LevelSetList;
use Rector\Set\ValueObject\SetList;

return static function (RectorConfig $rectorConfig): void {
    $rectorConfig->paths([
        __DIR__.'/bin',
        __DIR__.'/config',
        __DIR__.'/migrations',
        __DIR__.'/public',
        __DIR__.'/src',
        __DIR__.'/tests',
    ]);

    // exclude files
    $rectorConfig->skip([
        __DIR__.'/config/reference.php',
        __DIR__.'/config/bundles.php',
    ]);

    $rectorConfig->sets([
        SetList::CODE_QUALITY,
        SetList::CODING_STYLE,
        SetList::DEAD_CODE,
        SetList::EARLY_RETURN,
        SetList::PRIVATIZATION,
        SetList::INSTANCEOF,
        SetList::TYPE_DECLARATION,
        SetList::RECTOR_PRESET,
        LevelSetList::UP_TO_PHP_85,
    ]);
};

Expected Behaviour

If the class is already imported it should check it if @see is added already or not. (fully_classified)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions