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

Add Wallabag extension #254

Merged
merged 1 commit into from
Oct 19, 2024
Merged

Add Wallabag extension #254

merged 1 commit into from
Oct 19, 2024

Conversation

Joedmin
Copy link
Contributor

@Joedmin Joedmin commented Oct 19, 2024

No description provided.

Copy link
Member

@Frenzie Frenzie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look nice

@Alkarex Alkarex merged commit cab51a7 into FreshRSS:master Oct 19, 2024
1 check passed
@Alkarex
Copy link
Member

Alkarex commented Oct 19, 2024

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:

image

Example for level 3 (out of 9):

------ ---------------------------------------------------------------------------------------------------------- 
  Line   Extensions/third-party/efa6cebe6aedee2fa9cf94bde3d20c5883571c07/Controllers/wallabagButtonController.php  
 ------ ---------------------------------------------------------------------------------------------------------- 
  :8     Access to an undefined property Minz_View::$wallabag_button_vars.                                         
         💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property                      
  :9     Access to an undefined property FreshRSS_UserConfiguration::$wallabag_instance_url.                       
         💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property                      
  :10    Access to an undefined property FreshRSS_UserConfiguration::$wallabag_keyboard_shortcut.                  
         💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property                      
  :36    Access to an undefined property FreshRSS_UserConfiguration::$wallabag_instance_url.                       
         💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property                      
  :37    Access to an undefined property FreshRSS_UserConfiguration::$wallabag_username.                           
         💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property                      
  :38    Access to an undefined property FreshRSS_UserConfiguration::$wallabag_client_id.                          
         💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property                      
  :50    Access to an undefined property FreshRSS_UserConfiguration::$wallabag_client_secret.                      
         💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property                      
  :64    Access to an undefined property FreshRSS_UserConfiguration::$wallabag_access_token_expires_at.            
         💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property                      
  :69    Access to an undefined property FreshRSS_UserConfiguration::$wallabag_client_id.                          
         💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property                      
  :70    Access to an undefined property FreshRSS_UserConfiguration::$wallabag_client_secret.                      
         💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property                      
  :71    Access to an undefined property FreshRSS_UserConfiguration::$wallabag_refresh_token.                      
         💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property                      
  :90    Access to an undefined property FreshRSS_UserConfiguration::$wallabag_instance_url.                       
         💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property                      
  :91    Access to an undefined property FreshRSS_UserConfiguration::$wallabag_username.                           
         💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property                      
  :92    Access to an undefined property FreshRSS_UserConfiguration::$wallabag_client_id.                          
         💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property                      
  :93    Access to an undefined property FreshRSS_UserConfiguration::$wallabag_client_secret.                      
         💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property                      
  :94    Access to an undefined property FreshRSS_UserConfiguration::$wallabag_access_token.                       
         💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property                      
  :95    Access to an undefined property FreshRSS_UserConfiguration::$wallabag_refresh_token.                      
         💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property                      
  :96    Access to an undefined property FreshRSS_UserConfiguration::$wallabag_access_token_expires_at.            
         💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property                      
  :133   Access to an undefined property FreshRSS_UserConfiguration::$wallabag_access_token.                       
         💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property                      
  :161   Access to an undefined property FreshRSS_UserConfiguration::$wallabag_instance_url.                       
         💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property                      
  :181   Access to an undefined property FreshRSS_UserConfiguration::$wallabag_instance_url.                       
         💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property                      
  :228   Access to an undefined property FreshRSS_UserConfiguration::$wallabag_access_token.                       
         💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property                      
  :229   Access to an undefined property FreshRSS_UserConfiguration::$wallabag_refresh_token.                      
         💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property                      
  :230   Access to an undefined property FreshRSS_UserConfiguration::$wallabag_access_token_expires_at.            
         💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property                      
 ------ ---------------------------------------------------------------------------------------------------------- 

 ------ ------------------------------------------------------------------------------------------ 
  Line   Extensions/third-party/efa6cebe6aedee2fa9cf94bde3d20c5883571c07/configure.phtml           
 ------ ------------------------------------------------------------------------------------------ 
  :2     Access to an undefined property FreshRSS_UserConfiguration::$wallabag_instance_url.       
         💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property      
  :3     Access to an undefined property FreshRSS_UserConfiguration::$wallabag_client_id.          
         💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property      
  :4     Access to an undefined property FreshRSS_UserConfiguration::$wallabag_client_secret.      
         💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property      
  :5     Access to an undefined property FreshRSS_UserConfiguration::$wallabag_username.           
         💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property      
  :6     Access to an undefined property FreshRSS_UserConfiguration::$wallabag_access_token.       
         💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property      
  :7     Access to an undefined property FreshRSS_UserConfiguration::$wallabag_refresh_token.      
         💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property      
  :8     Access to an undefined property FreshRSS_UserConfiguration::$wallabag_keyboard_shortcut.  
         💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property      
  :11    Variable $this might not be defined.                                                      
  :27    Variable $this might not be defined.                                                      
  :43    Variable $password might not be defined.                                                  
  :67    Variable $this might not be defined.                                                      
 ------ ------------------------------------------------------------------------------------------ 

 ------ ------------------------------------------------------------------------------------------ 
  Line   Extensions/third-party/efa6cebe6aedee2fa9cf94bde3d20c5883571c07/extension.php             
 ------ ------------------------------------------------------------------------------------------ 
  :23    Access to an undefined property FreshRSS_UserConfiguration::$wallabag_keyboard_shortcut.  
         💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property      
 ------ ------------------------------------------------------------------------------------------ 

                                                                                                                        
 [ERROR] Found 36 errors                                                                                                

@Joedmin
Copy link
Contributor Author

Joedmin commented Oct 20, 2024

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? 🙏

@Alkarex
Copy link
Member

Alkarex commented Oct 20, 2024

@Joedmin See Joedmin/xExtension-wallabag-button#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

@Alkarex
Copy link
Member

Alkarex commented Oct 20, 2024

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/"
	]
}

@Joedmin
Copy link
Contributor Author

Joedmin commented Oct 21, 2024

Thank you very much @Alkarex! I'll take a look on it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants