Skip to content
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

Renaming class is not working #292

Open
vlady777 opened this issue Jul 26, 2023 · 2 comments
Open

Renaming class is not working #292

vlady777 opened this issue Jul 26, 2023 · 2 comments

Comments

@vlady777
Copy link

vlady777 commented Jul 26, 2023

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

@vlady777
Copy link
Author

All installed plugins were disabled and problem starts to reproduce right after PHP Annotations plugin is enabled (even without Symfony plugin).

@lukascocula
Copy link

I observed same issue today. I tried to reinstall plugin, invalidate caches, downgrade PHPstorm, reinstall PHPstorm, nothing helped. Only disabling/uninstall plugin helped.

PhpStorm 2023.3.2
Build #PS-233.13135.108, built on December 21, 2023
Runtime version: 17.0.9+7-b1087.9 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 14.1.1
GC: G1 Young Generation, G1 Old Generation
Memory: 4096M
Cores: 10
Metal Rendering is ON
Registry:
run.processes.with.pty=TRUE
Non-Bundled Plugins:
ru.adelf.idea.dotenv (2023.3)
de.espend.idea.php.annotation (9.4.0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants