Vscode-intelephense: Add setting to disable Non static method '' should not be called statically.

Created on 30 May 2020  路  5Comments  路  Source: bmewburn/vscode-intelephense

寰俊鎴浘_20200530164638

I have the __callStatic method, But it still prompts me a lot of info information,
I don't think this should be prompted.
Intelephense version 1.4.0
php version 7.4.0

diagnostics

Most helpful comment

This diagnostic is current bundled in with others under intelephense.diagnostics.languageConstraints . Will look at separating it out.

All 5 comments

Can you provide a code example that reproduces the problem? Is startTrans static or non-static? If it is declared non-static then I think this is valid diagnostic even if you have __callStatic.

寰俊鎴浘_20200530164638

the startTrans is non-static,
Can this info be shut down? I think it's a little annoying

This diagnostic is current bundled in with others under intelephense.diagnostics.languageConstraints . Will look at separating it out.

I think this option should be added, and the default is off state

@bmewburn

intelephense.diagnostics.languageConstraints

Thank you for the suggestion, it worked. I have a question, though: is there a "documented way" to find out which certain option helps to disable this or that Warning/Notice? Maybe, display it in the error message itself, like:

Non static method 'builder' should not be called statically.intelephense(1036)
You can disable this kind of messages via "intelephense.diagnostics.languageConstraints" option

Something like this.

Was this page helpful?
0 / 5 - 0 ratings