Add PSR-12 enforcement via PHP_CodeSniffer
๐ Description
Brief description of the changes made in this PR.
Enforces PSR-12 coding style across the src/ directory by integrating PHP_CodeSniffer. Auto-fixed existing violations using PHPCBF and manually resolved remaining warnings to achieve a fully clean baseline โ zero errors, zero warnings. โจ Type of Change
๐ Bug fix (fixes an issue) โจ New feature (adds functionality) ๐ง Refactoring (code restructuring without functional changes) ๐ Documentation (updates to documentation) ๐งช Tests (adding or modifying tests) ๐ Security (security-related fixes) โก Performance (performance improvements) ๐จ Style (formatting changes, no logic changes)
๐ Main Changes
Added squizlabs/php_codesniffer to require-dev in composer.json Added .phpcs.xml configuration file targeting PSR-12 for the src/ directory Added composer run cs and composer run cs-fix scripts via phpcs and phpcbf Auto-fixed formatting violations in src/OauthClient.php and src/Transports/CurlTransport.php using PHPCBF Manually fixed constant visibility warnings in src/OauthClient.php Manually fixed long method signature in src/ApiException.php Suppressed intentional PSR-1 side-effects warning in src/Bootstrap.php
๐งช Testing
I have tested the changes locally I have added/updated unit tests All tests pass (./vendor/bin/phpunit) I have verified PHP 8.0+ compatibility
๐ Additional Notes vendor/bin/phpcs reports zero errors and zero warnings across all 10 scanned files. No logic or functionality was changed โ only formatting and style enforcement tooling was added. ๐ Related Issue Closes #22
Ready for review @francescobianco vendor/bin/phpcs reports zero errors and zero warnings locally. Happy to make any adjustments based on your feedback
Thanks @muhammadshaharyaraulakh for the excellent contribution! ๐
I've reviewed the PR and I'm happy to accept it. Having a clean PSR-12 baseline and the associated tooling in place is a great improvement for the project, and I appreciate the care taken to keep this as a style-only change without affecting functionality.
Before merging, I'd just ask one small thing: please follow our contributor onboarding guide to add yourself as an official contributor to the project:
๐ https://github.com/openapi/contributors
We're always happy to welcome new contributors to the OpenAPI community, and we'd love to recognize your contribution properly.
Thanks again for your work, and welcome aboard! ๐