bmewburn / vscode-intelephense

PHP intellisense for Visual Studio Code
https://intelephense.com
Other
1.61k stars 94 forks source link

Undefined method '?'. intelephense(1013) -- No quick fixes available #1413

Closed rodrigoguariento closed 4 years ago

rodrigoguariento commented 4 years ago

Describe the bug image

To Reproduce image

Expected behavior The method exists and works in this structure.

Platform and version Ubuntu 18.04LTS + VSCode 1.49.0 + PHP Intelephense v1.5.4 image

Thank you.

bmewburn commented 4 years ago

Have you tried running this example? sayHello is protected.

rodrigoguariento commented 4 years ago

Have you tried running this example? sayHello is protected.

Thanks! I've reviewed my code.

isxoqovbegzod commented 2 years ago

Undefined method 'can'.intelephense(1013)

isxoqovbegzod commented 2 years ago

public function shouldBeDisplayed() { return Auth::user()->can('browse', Voyager::model('Page')); } }

An error occurred in the (can) method

isxoqovbegzod commented 2 years ago

hellp hellp

sajanaKaru commented 2 years ago

Undefined method 'can'.intelephense(1013)

same problem

nettsite commented 2 years ago

Undefined method 'can'.intelephense(1013)

gets triggered by this code:

if (!Auth::user()->can('all-clients')) { return; }

but the code runs fine.

andradenathan commented 2 years ago

I have the same problem but I still don't know how to solve. Is there any option in setting.json that should be changed?

nettsite commented 2 years ago

I installed barryvdh/laravel-ide-helper and ran php artisan ide-helper:generate and that seems to have solved it for me. I am using VS Code.

luis-daniell commented 2 years ago

I had the same problem that the method worked but it gave me the error, what I did was uninstall the "PHP Intelephense" plugin.

reynold-lee commented 2 years ago

I have same problem.

help me please.

akardev commented 2 years ago

go setting settings json

and paste

"intelephense.telemetry.enabled": false, "intelephense.completion.triggerParameterHints": true, "intelephense.completion.insertUseDeclaration": true, "intelephense.trace.server": "messages", "intelephense.diagnostics.undefinedClassConstants": false, "intelephense.diagnostics.undefinedFunctions": false, "intelephense.diagnostics.undefinedConstants": false, "intelephense.diagnostics.undefinedProperties": false, "intelephense.diagnostics.undefinedTypes": false, "intelephense.diagnostics.undefinedMethods": false,

Aldo-f commented 10 months ago

Maybe we could just add an ignore next line to check?

Mm, seems that is already possible:

/** @disregard [OPTIONAL CODE] [OPTIONAL DESCRIPTION] */

https://github.com/bmewburn/vscode-intelephense/issues/568#issuecomment-1763662245

maxime-dot commented 10 months ago

I have the same issue, So I got rid of the PHP Intelephense extension

superManJHss commented 9 months ago

with a old version