Skip to content

RenameClassRector ignored use. #7549

@atlance

Description

@atlance

Bug Report

Subject Details
Rector version 0.14.6
  1. In composer.json
        "psr/simple-cache": "^3.0",
        "symfony/cache": "^6.1",
  1. Rector config:
use Rector\Symfony\Set\SymfonyLevelSetList;
// ....
    $rectorConfig->sets([
        // ...
        SymfonyLevelSetList::UP_TO_SYMFONY_60, // <- problem here.
        // ...
    ]);
// ....
  1. Exists class:
use Psr\SimpleCache\CacheInterface;

class SimpleCacheBridge implements CacheInterface

Problem:
Result after vendor/bin/rector process:

1) src/SimpleCacheBridge.php:5

    ---------- begin diff ----------
@@ @@

 use Psr\SimpleCache\CacheInterface;

-class SimpleCacheBridge implements CacheInterface
+class SimpleCacheBridge implements \Symfony\Contracts\Cache\CacheInterface
 {
     public function get(string $key, mixed $default = null): mixed
     {
    ----------- end diff -----------

Applied rules:
 .................
 * RenameClassRector
  .................

Exists difference between interfaces/classes. Ignored use.

Maybe he should skip it? =)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions