appwrite
appwrite copied to clipboard
🔎 Add Code Analyzer To ‘utopia-php/websocket’
💭 Introduction
Code analyzer is one of the most valuable tools in the open source world. It not only ensures every high quality of the code but also allows CI/CD to ensure this. A code analyzer can find a potential bug, unexpected null value, or type mismatch. Having a code analyzer set up should be a high priority for every project as it makes the project more stable and bug-proof.
Your task is to update our library utopia-php/websocket and implement a code analyzer. We would like to use PHPStan as our analyzer.
To make this task easy, we created a sample pull request showing what exactly needs to be done to implement the analyzer into the Utopia PHP library: https://github.com/utopia-php/ab/pull/8
🎯 Requirements
- Experience with GitHub Actions.
- Experience with Composer.
- Experience with PHP.
✅ Task Summary
- [ ] Ask to be assigned to the issue.
- [ ] Wait to be assigned.
- [ ] Implement code analyzer in utopia-php/websocket (use https://github.com/utopia-php/ab/pull/8 as template)
- [ ] Run code analyzer to check existing code, and update it if required
- [ ] Submit a pull request in utopia-php/websocket.
Please configure PHPStan to max level (9). If that gives you too many problems that you cannot solve, please drop to level 8. If you have trouble with level 8 as well, let us know, and we can consider a lower level on some repositories.
If you have questions, need any help, or just want to hang out, make sure to join us on our Discord server.
Happy Appwriting!
Can I be assigned this issue
@aaheli8 , thanks for your interest! 🙏 Happy hacking! 🎃
@Meldiron Thank You very much
Working on it
Hello, I am using PHPStan level 9 to analyze the code and got 13 errors. The most common error is "No value type specified in iterable type" and I would like to fix it, could you please provide any help or documentation on how to fix it?
@aaheli8 I faced this issue as well, more info here: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type
It means there is type array specified, but that is too generic. We need to be specific and say it's for example array of strings array<string> or array where key is string and value is integer array<string,int>.
@Meldiron Thank you, I am looking into it.
I have created the PR, please review it.