-
Notifications
You must be signed in to change notification settings - Fork 34
Add composer.json with PHP 7.4+ support, phpcs, phpstan, and phpunit #16
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
Conversation
I made some assumptions in this PR that may be inaccurate. 1. I'm assuming we'll be using PHPStan. I'll PR a suggested `phpstan.neon.dist` in a follow-up PR. 2. Is `WordPress\AI` the correct namespace? The main bits: - Configures package as wordpress/php-ai-client library - Requires PHP 7.4 or higher - Adds PHPUnit and PHPStan as dev dependencies - Sets up PSR-4 autoloading with WordPress\AI namespace - Includes convenient scripts for testing and analysis - Adds keywords for package discovery
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Add phpstan.neon.dist with max level analysis - Add phpcs.xml.dist with PSR-12 coding standards - Configure both tools to scan src/ and tests/ directories - Set up parallel processing and colored output for phpcs
Co-authored-by: Felix Arntz <flixos90@gmail.com>
Co-authored-by: Felix Arntz <flixos90@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Just two minor comments, but I'm preemptively approving.
Other than this, it would be great to add a GitHub workflow that runs these tools on every commit and for pull requests. Feel free to add it here, or we could do it in a follow up PR.
| <!-- Use PSR-12 standard --> | ||
| <rule ref="PSR12"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a note, here, we can encourage folks to use PER-3.0 in the CONTRIBUTING doc, as that extends PSR-12, but unfortunately PHPCS doesn't support PER.
|
Let's do the workflows in another PR 🕺 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for putting this together, @borkweb!
I made some assumptions in this PR that may be inaccurate.
phpstan.neon.distin a follow-up PR.IsUpdated toWordPress\AIthe correct namespace?WordPress\AiClientThe main bits: