php-mod/curl

Getters for response, status code and others

jormaechea opened this issue · 1 comments

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.

Fixed #59