Add PSR-12 enforcement via PHP_CodeSniffer#37
Open
muhammadshaharyaraulakh wants to merge 1 commit into
Open
Conversation
Author
|
Ready for review @francescobianco vendor/bin/phpcs reports zero errors and zero warnings locally. Happy to make any adjustments based on your feedback |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📋 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