Closed Joedmin closed 1 month ago
I've seen those warnings in VS Code yet I decided to ignore them since I saw them in the original Pocker Extension, which I used as a base.
How can I give my code (and thus PHPStan) the context of FreshRSS so it does not show these errors? May I ask you for guidance, please? 🙏
@Joedmin See https://github.com/Joedmin/xExtension-wallabag-button/pull/1 The initial code was severely outdated, so there were plenty of fixes to do just to pass the initial quality levels. If you are motivated enough, it would be excellent to make the same changes to other extensions you encounter
How can I give my code (and thus PHPStan) the context of FreshRSS
You should have the FreshRSS folder alongside your extension folder, and tell your editor tools about its path.
For instance, for the Intelephense extension for PHP in VSCode, you can set the following in your .vscode/settings.json
:
{
"intelephense.environment.includePaths": [
"../FreshRSS/"
]
}
Thank you very much @Alkarex! I'll take a look on it
Thanks 👍🏻 I would like to encourage you to run PHPStan on your extension, on the model of what we do for the extensions hosted in https://github.com/FreshRSS/Extensions
That would spot several problems. Check also the deprecations:
Example for level 3 (out of 9):