diff options
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; } /** |