php-http-client
php-http-client copied to clipboard
feat: enable endpoint version selection
Fixes
This update allows the selection of and endpoint version, needed in cases like Segmenting contacts V2 -> Update segment
As you can see, the example code snippet in the doc, uses a syntax that is not compatible with php (calling the endpoint is in fact not possible):
$response = $sg->client->marketing()->segments()->2.0()->_($segment_id)->patch();
// ^^^^ wrong syntax
# working example
$response = $sg->client->marketing()->segments()->_version('2.0')->_($segment_id)->patch();
// ^^^^^^^^^^^^^^
Contents
- utility method to set version in the URL
- unit test of the new functionality
- improved readability with null coalescing operator
Checklist
- [x] I acknowledge that all my contributions will be made under the project's license
- [x] I have made a material change to the repo (functionality, testing, spelling, grammar)
- [x] I have read the Contribution Guidelines and my PR follows them
- [x] I have titled the PR appropriately
- [x] I have updated my branch with the main branch
- [x] I have added tests that prove my fix is effective or that my feature works
- [ ] I have added the necessary documentation about the functionality in the appropriate .md file
- [x] I have added inline documentation to the code I modified
If you have questions, please file a support ticket.
@twilio-dx any news about this PR? Thanks
Hi @funder7! We have added this to our list and we'll be prioritising it soon. Thanks!
Hi, do you think that this and the other PR #159 will be merged at some point? :-)