Skip to content

Add PSR-12 enforcement via PHP_CodeSniffer#37

Open
muhammadshaharyaraulakh wants to merge 1 commit into
openapi:mainfrom
muhammadshaharyaraulakh:feature/enforce-psr12-coding-style
Open

Add PSR-12 enforcement via PHP_CodeSniffer#37
muhammadshaharyaraulakh wants to merge 1 commit into
openapi:mainfrom
muhammadshaharyaraulakh:feature/enforce-psr12-coding-style

Conversation

@muhammadshaharyaraulakh
Copy link
Copy Markdown

📋 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

@muhammadshaharyaraulakh
Copy link
Copy Markdown
Author

Ready for review @francescobianco vendor/bin/phpcs reports zero errors and zero warnings locally. Happy to make any adjustments based on your feedback

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

Successfully merging this pull request may close these issues.

Enforce PSR-12 coding style with PHP_CodeSniffer

1 participant