diff options
author | Avi Goldman <avrahamymgoldman@gmail.com> | 2016-06-23 09:43:56 -0400 |
---|---|---|
committer | Avi Goldman <avrahamymgoldman@gmail.com> | 2016-06-23 09:43:56 -0400 |
commit | f79318aeea95c0ce7fb8d5ef376a2b0b97f3c140 (patch) | |
tree | 60c4073730c4870404717d2ed3b152bc899371c1 /lib/SparkPost | |
parent | fda0a912a79ef6a7e5ea95123bd305fb712f80db (diff) | |
download | php-sparkpost-f79318aeea95c0ce7fb8d5ef376a2b0b97f3c140.zip php-sparkpost-f79318aeea95c0ce7fb8d5ef376a2b0b97f3c140.tar.gz php-sparkpost-f79318aeea95c0ce7fb8d5ef376a2b0b97f3c140.tar.bz2 |
fixed examples, and small details
Diffstat (limited to 'lib/SparkPost')
-rw-r--r-- | lib/SparkPost/Resource.php | 4 | ||||
-rw-r--r-- | lib/SparkPost/SparkPostResponse.php | 2 | ||||
-rw-r--r-- | lib/SparkPost/Transmission.php | 14 |
3 files changed, 10 insertions, 10 deletions
diff --git a/lib/SparkPost/Resource.php b/lib/SparkPost/Resource.php index 7fab937..7c88743 100644 --- a/lib/SparkPost/Resource.php +++ b/lib/SparkPost/Resource.php @@ -17,7 +17,7 @@ class Resource /** * Sets up the Resource. * - * @param SparKPost $sparkpost - the sparkpost instance that this resource is attached to + * @param SparkPost $sparkpost - the sparkpost instance that this resource is attached to * @param string $endpoint - the endpoint that this resource wraps */ public function __construct(SparkPost $sparkpost, $endpoint) @@ -82,7 +82,7 @@ class Resource } $uri = $this->endpoint.'/'.$uri; - + return $this->sparkpost->request($method, $uri, $payload, $headers); } } diff --git a/lib/SparkPost/SparkPostResponse.php b/lib/SparkPost/SparkPostResponse.php index 08750f9..e6a8fd1 100644 --- a/lib/SparkPost/SparkPostResponse.php +++ b/lib/SparkPost/SparkPostResponse.php @@ -38,7 +38,7 @@ class SparkPostResponse implements ResponseInterface } /** - * pass these down to the response given in the constructor + * pass these down to the response given in the constructor. */ public function getProtocolVersion() { diff --git a/lib/SparkPost/Transmission.php b/lib/SparkPost/Transmission.php index 1847e1b..6c45c7e 100644 --- a/lib/SparkPost/Transmission.php +++ b/lib/SparkPost/Transmission.php @@ -137,22 +137,22 @@ class Transmission extends Resource */ private function toAddressObject($address) { - $return = $address; - if (is_string($address)) { - $return = []; + $formatted = $address; + if (is_string($formatted)) { + $formatted = []; if ($this->isEmail($address)) { - $return['email'] = $address; + $formatted['email'] = $address; } elseif (preg_match('/"?(.[^"]*)?"?\s*<(.+)>/', $address, $matches)) { $name = trim($matches[1]); - $return['name'] = $matches[1]; - $return['email'] = $matches[2]; + $formatted['name'] = $matches[1]; + $formatted['email'] = $matches[2]; } else { throw new \Exception('Invalid address format: '.$address); } } - return $return; + return $formatted; } /** |