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

Improper static call suggestion with Laravel Idea helper code #1955

Open
dcaswel opened this issue Sep 18, 2024 · 1 comment
Open

Improper static call suggestion with Laravel Idea helper code #1955

dcaswel opened this issue Sep 18, 2024 · 1 comment

Comments

@dcaswel
Copy link

dcaswel commented Sep 18, 2024

Subject Details
Plugin Php Inspections (EA Extended) v5.0.0.0
Language level PHP 8.2

Current behaviour

I have a Laravel app and I use the Laravel Idea plugin. That plugin creates 2 related helper files. One for static methods that came from a macro and one for non-static methods that came from a macro. In the screenshot, the restore method is one of those methods that comes from a macro. It actually doesn't make a lot of sense to run the restore method statically but the Php Inspections plugin is reading from the static helper file instead of the non-static one so I'm getting this warning saying that it should be called statically.

Screenshot 2024-09-18 at 6 30 56 AM

Expected behaviour

I would expect that it doesn't give this warning as the method is being used correctly.

Environment details

PhpStorm 2024.2.1
Build #PS-242.21829.154, built on August 29, 2024
Runtime version: 21.0.3+13-b509.11 aarch64 (JCEF 122.1.9)
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Toolkit: sun.lwawt.macosx.LWCToolkit
macOS 14.6.1
GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
Memory: 4096M
Cores: 12
Metal Rendering is ON
Registry:
debugger.new.tool.window.layout=true
run.processes.with.pty=TRUE
ide.experimental.ui=true
i18n.locale=
terminal.new.ui=true
Non-Bundled Plugins:
com.intellij.lang.puppet (242.20224.159)
com.jetbrains.space (242.21829.142)
String Manipulation (9.14.1)
com.intellij.ml.llm (242.21829.196)
org.jetbrains.plugins.gitlab (242.21829.162)
org.jetbrains.plugins.github (242.21829.162)
com.intellij.angularjs (242.20224.155)
com.jetbrains.lang.ejs (242.20224.155)
com.github.inxilpro.intellijalpine (v0.4.2)
com.kalessil.phpStorm.phpInspectionsEA (5.0.0.0)
ru.adelf.idea.dotenv (2024.2.1)
de.espend.idea.php.annotation (11.0.3)
com.laravel_idea.plugin (8.2.5.242)
dev.ekvedaras.laravelquery (4.0.4)
com.mallowigi (97.0.0)
dev.nx.console (1.31.0)

@ea-inspections-team
Copy link
Collaborator

Thank you for reporting @dcaswel!

Would it be possible for you to share all available method definitions (possibly simplified)?

We have limited exposure to Laravel development and need to understand if method resolving is working correctly or inspection itself needs improvements.

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