All functions show unused even it is being used

Hello, JetBrains community,

 

I'm encountering an issue with PhpStorm, where all my functions are flagged as "unused" even though they are being called and used in my code. I'm hoping someone here can help me resolve this issue, as it's affecting my ability to use the IDE effectively.

Description of the issue:

  1. I've created several functions in my PHP project, all used in various places within the code.
  2. However, PhpStorm is showing a warning for each function, stating that the function is "unused."
  3. This is causing unnecessary clutter in the editor and making it difficult to identify genuine issues in the code.

Environment details:

  • PhpStorm version: 2023.1.1
  • PHP version: 8.4.1
  • Operating System: macOS Ventura 13.3.1 (22E261)

Steps to reproduce:

  1. Create a new PHP file with a function.
  2. Then, use the function in the same or another PHP file in the project.
  3. Notice that PhpStorm flags the function as "unused" even though it's being called.

What I've tried so far:

  1. I've checked the PhpStorm settings for code inspection and ensured that "Unused" is not disabled or misconfigured.
  2. I've invalidated the PhpStorm cache and restarted the IDE multiple times.
  3. I've updated PhpStorm to the latest version and tried it on a different machine with a fresh installation.

None of the above solutions have resolved the issue.

I've searched the forum and online resources for a solution but haven't found any relevant threads or articles addressing this issue. Please let me know if anyone has experienced a similar problem or has any suggestions. I appreciate your assistance!

Many thanks for considering my request.

Best regards,

Jatin Soni

0

Hey Jatin,

I was not able to quickly reproduce it on PhpStorm 2023.1.1:

Usually, a caches invalidates may help but as far as I see, you have tried it already.
Is it reproducible for you on a fresh new project as well? Do you have any custom plugins?

0

For what it’s worth, I experience this constantly. Here is a screenshot of the IDE being undecided. The grayed-out color and the inlay hint suggest no usages, but the „find usages” popup has results

0

请先登录再写评论。