DEVSENSE / phptools-docs

PHP Tools public content
Apache License 2.0
84 stars 10 forks source link

Error warnings sometimes appear in `vendor` #643

Closed ging-dev closed 2 months ago

ging-dev commented 2 months ago

They sometimes appear for no apparent reason, I have to open the file with the error warning and close the file and the error will be hidden, however they will appear again a while later: image

ging-dev commented 2 months ago

Call to unknown function: 'get_terms' with package php-stubs/wordpress-stubs, it seems get_terms is not cached even though it is defined

jakubmisek commented 2 months ago

This may be caused by an invalid composer.json? or the package is missing in your composer.json?

Please try to run the command "clear /vendor/ cache" if it helps.

jakubmisek commented 2 months ago

The function may be hidden because of its @internal phpdoc tag, I'll take a look at it because we should not treat it like this.

ging-dev commented 2 months ago

The function may be hidden because of its @internal phpdoc tag, I'll take a look at it because we should not treat it like this.

Perhaps hiding the @internal method is not a good idea, some package use it incorrectly, instead a gray warning should be given to users to be careful when using them.

jakubmisek commented 2 months ago

fixed, thanks :)

jakubmisek commented 2 months ago

after the update, clear vendor cache may be needed

jakubmisek commented 2 months ago

FYI: we have included the stub for Wordpress (command pallete -> PHP: stubs -> Wordpress)

ofcourse this @internal function is not there yet either, but it will