-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make HTTP requests using curl with fallback to file stream #302
Conversation
throw new \RuntimeException('allow_url_fopen must be enabled to use PHP streams.'); | ||
} | ||
} | ||
return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code by gravity. Use guard clauses and avoid if elseif pyramids.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make requests great again!
$response = json_decode($response); | ||
} | ||
} else { | ||
if(curl_errno($this->curl)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a few weird responses that don't use 200, in case of api business rules validations.
The ignoredStatusCodes array was built to filter them out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make requests great again x2
No description provided.