Conversation
11f6958 to
cca92a9
Compare
jrfnl
reviewed
Oct 9, 2023
Member
jrfnl
left a comment
There was a problem hiding this comment.
Reviewed. Left a few notes. Nothing major.
184208a to
617a5df
Compare
617a5df to
9a3ee12
Compare
jrfnl
requested changes
Dec 11, 2023
Member
jrfnl
left a comment
There was a problem hiding this comment.
Looking good, left a few notes inline. Nothing major.
e4ec849 to
b66215b
Compare
jrfnl
approved these changes
Jan 9, 2024
Member
jrfnl
left a comment
There was a problem hiding this comment.
Thanks for all your work on this @schlessera ! LGTM.
I've added two small commits still with some very minor nitpicks (mostly CS).
Do you want to clean up the branch before merge ? Or shall I merge it as is ?
Member
|
P.S.: build failures are due to GH having trouble. We'll probably best restart them once GH has recovered. |
47cda6a to
05df33a
Compare
This class provides constants with the available HTTP status codes with thorough documentation based on https://developer.mozilla.org/en-US/docs/Web/HTTP/Status. It also comes with helper functions get_text($code) and is_valid_code($code) to simplify consuming code.
05df33a to
451f7b0
Compare
Member
|
Yippia-a-yeah! Ready for merge once the build finishes. |
12 tasks
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.
This PR adds a utility class to deal with HTTP status codes and messages and then changes existing code in
Httpexceptions and theTransportMockto make use of this utility class.Pull Request Type
This is a:
Context
PR #582 added a new
TransportRedirectMockwhich was based onTransportMock. While doing so, it needed to duplicate the long list of status code messages already included inTransportMock. To make this process easier and simplify maintenance, we decided to extract knowledge about HTTP status codes and texts into a separate utility class instead, making both transport mock classes simpler in the process.Detailed Description
The new helper class
HttpStatuscontains two methods:get_text($code)retrieves a status text from a status codeis_valid_code($code)returns a boolean on whether a given code is a valid (known) status codeThe helper class also contains constants that can be directly referenced, like so:
The PR updates all
Httpexceptions to make use of this to de-duplicate the status text strings.Quality assurance
Documentation
For new features:
examplesdirectory.docsdirectory.If the documentation is in a new markdown file, I have added a link to this new file to the Docs folder
README.mdfile.