8000 Getters for response, status code and others · Issue #58 · php-mod/curl · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Getters for response, status code and others #58

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

Closed
jormaechea opened this issue Nov 27, 2018 · 1 comment
Closed

Getters for response, status code and others #58

jormaechea opened this issue Nov 27, 2018 · 1 comment

Comments

@jormaechea
Copy link
Contributor

It would be nice to have some more getters, so I don't depend on the object properties, and also mock this lib properly in my projects.
For tests, it's cleaner to mock methods than just setting the $curl->response property, for example.

The following getters would be appreciated:

public function getResponse(); // Returns response prop

public function getErrorCode(); // Returns curl_error_code prop

public function getErrorMessage(); // Returns curl_error_message prop

public function getHttpStatus(); // Returns http_status_code prop

Of course I could build a wrapper for this, but then I'd have two dependencies for something as simple as making a request.

jormaechea added a commit to jormaechea/curl that referenced this issue Dec 4, 2018
amouhzi pushed a commit that referenced this issue Dec 4, 2018
@amouhzi
Copy link
Member
amouhzi commented Dec 4, 2018

Fixed #59

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants
0