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

Consider adding static analysis #709

Open
BackEndTea opened this issue Jul 12, 2022 · 2 comments
Open

Consider adding static analysis #709

BackEndTea opened this issue Jul 12, 2022 · 2 comments

Comments

@BackEndTea
Copy link
Contributor

  • Algolia Client Version: N/A
  • Language Version: N/A

Description

Consider using a static analysis tool (like PHPStan or Pslam), in order to catch basic errors, like the class not found issue introduced recently.

Currently there is no way to verify that code that is not covered by tests isn't broken. With static analysis all code would be automatically type checked, which should make it (nearly) impossible for these kind of errors to happen.

It shouldn't be too much work to set it up with real low strictness, which should catch any basic errors. At a later point it could be configured to be more strict, catching more specific errors.

If you need any help with setting this up, i'd be more than happy to help.

@bodinsamuel
Copy link

Hello, thanks for the report.
It's unfortunate that those kind bug are appearing. However there is good news, we are in the process of releasing a new major that will have better testing overall ☺️

Code is there: https://github.com/algolia/algoliasearch-client-php/tree/next
Source is there: https://github.com/algolia/api-clients-automation

@BackEndTea
Copy link
Contributor Author

Hey, thats great to see!

But even in a new major static analysis would still be beneficial to the overall quality of the project.
Plus it would also help better document types towards the user.

Especially since this is a new major, and adding/changing types could be a BC break, this seems like the perfect time to add those.

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

No branches or pull requests

2 participants