@@ -25,7 +25,7 @@ class MailChimp
2525 * Create a new instance
2626 * @param string $api_key Your MailChimp API key
2727 */
28- function __construct ($ api_key )
28+ public function __construct ($ api_key )
2929 {
3030 $ this ->api_key = $ api_key ;
3131 list (, $ datacentre ) = explode ('- ' , $ this ->api_key );
@@ -38,7 +38,7 @@ function __construct($api_key)
3838 * @param array $args An array of arguments to pass to the method. Will be json-encoded for you.
3939 * @return array Associative array of json decoded API response.
4040 */
41- public function call ($ method , $ args= array (), $ timeout = 10 )
41+ public function call ($ method , $ args = array (), $ timeout = 10 )
4242 {
4343 return $ this ->makeRequest ($ method , $ args , $ timeout );
4444 }
@@ -49,18 +49,18 @@ public function call($method, $args=array(), $timeout = 10)
4949 * @param array $args Assoc array of parameters to be passed
5050 * @return array Assoc array of decoded result
5151 */
52- private function makeRequest ($ method , $ args= array (), $ timeout = 10 )
53- {
52+ private function makeRequest ($ method , $ args = array (), $ timeout = 10 )
53+ {
5454 $ args ['apikey ' ] = $ this ->api_key ;
5555
5656 $ url = $ this ->api_endpoint .'/ ' .$ method .'.json ' ;
5757 $ json_data = json_encode ($ args );
5858
59- if (function_exists ('curl_init ' ) && function_exists ('curl_setopt ' )){
59+ if (function_exists ('curl_init ' ) && function_exists ('curl_setopt ' )) {
6060 $ ch = curl_init ();
6161 curl_setopt ($ ch , CURLOPT_URL , $ url );
6262 curl_setopt ($ ch , CURLOPT_HTTPHEADER , array ('Content-Type: application/json ' ));
63- curl_setopt ($ ch , CURLOPT_USERAGENT , 'PHP-MCAPI/2.0 ' );
63+ curl_setopt ($ ch , CURLOPT_USERAGENT , 'PHP-MCAPI/2.0 ' );
6464 curl_setopt ($ ch , CURLOPT_RETURNTRANSFER , true );
6565 curl_setopt ($ ch , CURLOPT_TIMEOUT , $ timeout );
6666 curl_setopt ($ ch , CURLOPT_POST , true );
0 commit comments