Rename class is not working totally (or partially in case of many usages) when there are at least one test case with @covers annotation.
To reproduce behavior, plase create two classes in SF directory structure like the following:
<?php
declare(strict_types=1);
namespace App\Service;
class SomeService
{
public function someMethod(): bool
{
return true;
}
}
and
<?php
declare(strict_types=1);
namespace App\Tests\Service;
use App\Service\SomeService;
use PHPUnit\Framework\TestCase;
class SomeServiceTest extends TestCase
{
/**
* @covers \App\Service\SomeService::someMethod
*/
public function testSomeMethod(): void
{
self::assertTrue((new RenamedService())->someMethod());
}
}
Next try to rename SomeService to something else (Shift+F6). Class (and file) will not be renamed.
If plugin is disabled renaming works as expected.
It's related to the following lines:
/**
* @covers \App\Service\SomeService::someMethod
*/
if there will be short classname @covers SomeService::someMethod will works as expected.
Also it works fine if dynamic usages are excluded (plugin enabled)

Please check and fix.


PhpStorm 2023.1.4
Build #PS-231.9225.18, built on July 13, 2023
Licensed to SIA "ATTA-1" / Vlad Yarus
Subscription is active until November 14, 2023.
Runtime version: 17.0.7+10-b829.16 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Linux 6.2.0-26-generic
GC: G1 Young Generation, G1 Old Generation
Memory: 4096M
Cores: 8
Registry:
debugger.watches.in.variables=false
run.processes.with.pty=TRUE
documentation.show.toolbar=true
Non-Bundled Plugins:
com.kalessil.phpStorm.phpInspectionsEA (5.0.0.0)
ru.adelf.idea.dotenv (2023.1)
de.espend.idea.php.annotation (9.4.0)
fr.adrienbrault.idea.symfony2plugin (2022.1.253)
Current Desktop: X-Cinnamon
Rename class is not working totally (or partially in case of many usages) when there are at least one test case with
@coversannotation.To reproduce behavior, plase create two classes in SF directory structure like the following:
and
Next try to rename
SomeServiceto something else (Shift+F6). Class (and file) will not be renamed.If plugin is disabled renaming works as expected.
It's related to the following lines:
if there will be short classname
@covers SomeService::someMethodwill works as expected.Also it works fine if dynamic usages are excluded (plugin enabled)

Please check and fix.
PhpStorm 2023.1.4
Build #PS-231.9225.18, built on July 13, 2023
Licensed to SIA "ATTA-1" / Vlad Yarus
Subscription is active until November 14, 2023.
Runtime version: 17.0.7+10-b829.16 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Linux 6.2.0-26-generic
GC: G1 Young Generation, G1 Old Generation
Memory: 4096M
Cores: 8
Registry:
debugger.watches.in.variables=false
run.processes.with.pty=TRUE
documentation.show.toolbar=true
Non-Bundled Plugins:
com.kalessil.phpStorm.phpInspectionsEA (5.0.0.0)
ru.adelf.idea.dotenv (2023.1)
de.espend.idea.php.annotation (9.4.0)
fr.adrienbrault.idea.symfony2plugin (2022.1.253)
Current Desktop: X-Cinnamon