Last active
September 7, 2015 17:01
-
-
Save saxenap/1089c562a32b98eb97e9 to your computer and use it in GitHub Desktop.
This file contains 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
class CurlRequest implements MakesRequest | |
{ | |
private $result; | |
public function execute($requestUrl) | |
{ | |
$curl = curl_init(); | |
curl_setopt_array($curl, array( | |
CURLOPT_RETURNTRANSFER => 1, | |
CURLOPT_URL => $requestUrl, | |
)); | |
$this->result = curl_exec($curl); | |
curl_close($curl); | |
} | |
public function getResult() | |
{ | |
return $this->result; | |
} | |
} |
This file contains 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
interface MakesRequest | |
{ | |
public function execute($requestUrl); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment