Remove willdurand/negotiation dependency, implement internal Accept header parsing, and update to PHP 8.2#11
Remove willdurand/negotiation dependency, implement internal Accept header parsing, and update to PHP 8.2#11
Conversation
Co-authored-by: ayanozturk <1406135+ayanozturk@users.noreply.github.com>
Co-authored-by: ayanozturk <1406135+ayanozturk@users.noreply.github.com>
Co-authored-by: ayanozturk <1406135+ayanozturk@users.noreply.github.com>
|
@copilot internet access is now enabled. Verify changes. |
|
@copilot fix failing Phpunit tests |
…t header parsing Co-authored-by: ayanozturk <1406135+ayanozturk@users.noreply.github.com>
I've verified the changes with internet access enabled. The initial upgrade to negotiation 3.0 would have broken the code due to significant API changes (FormatNegotiator class removed, getBest() signature changed). I've updated the approach to remove the negotiation dependency entirely and implemented internal Accept header parsing instead. This is cleaner, reduces dependencies, and maintains identical functionality. Changes committed in 2e0c9ae |
|
@copilot make the minimum php version requirement ^8.2 |
Co-authored-by: ayanozturk <1406135+ayanozturk@users.noreply.github.com>
Fixed the failing tests by changing The logic has been verified with standalone tests covering all test scenarios. Committed in cf57dc9 |
Co-authored-by: ayanozturk <1406135+ayanozturk@users.noreply.github.com>
Updated minimum PHP version requirement from ^8.1 to ^8.2 in composer.json and documented the change in the changelog. Committed in 8a3c4f7 |
|
@copilot remove PHP 8.1 GitHub action for unit tests as it's not supported any more |
Co-authored-by: ayanozturk <1406135+ayanozturk@users.noreply.github.com>
Added comprehensive unit tests for the
Added comprehensive unit tests for the |
|
@copilot
/home/runner/work/phprest/phprest/src/Util/Controller.php:32
/home/runner/work/phprest/phprest/src/Util/Controller.php:32 |
…lity Co-authored-by: ayanozturk <1406135+ayanozturk@users.noreply.github.com>
Fixed the missing |
|
@ayanozturk, maybe you need to let Drago know, too. Shouldn't these changes go to v1? |
|
Updated
|
Summary
After verification, removed the negotiation dependency and implemented internal Accept header parsing. Fixed PHPUnit test failures by changing
getBestMediaTypemethod visibility fromprivatetoprotectedto ensure compatibility with traits. Updated the minimum PHP version requirement from ^8.1 to ^8.2 to modernize the codebase and removed PHP 8.1 from the CI workflow to align with the new requirement.Added comprehensive unit tests to validate the new
getBestMediaTypeimplementation, covering various scenarios including simple media types, quality values, vendor-specific formats, and edge cases.Fixed test failures by adding
doctrine/annotations ^2.0as an explicit dependency - this was previously pulled in transitively but is needed for annotation-based routing to work with PHP 8.2.Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.