Skip to content
This repository has been archived by the owner on Oct 16, 2019. It is now read-only.

Commit

Permalink
Resolve coding standard violations
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Willbanks committed Jun 25, 2013
1 parent a6e8ecd commit 3c96fe0
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions library/ZendService/Amazon/Ec2/AbstractEc2.php
Expand Up @@ -66,17 +66,17 @@ abstract class AbstractEc2 extends Amazon\AbstractAmazon
* @var array
*/
protected static $_validEc2Regions = array(
'us-east-1', 'us-west-2', 'us-west-1', 'eu-west-1',
'ap-southeast-1', 'ap-southeast-2', 'ap-northeast-1',
'us-east-1', 'us-west-2', 'us-west-1', 'eu-west-1',
'ap-southeast-1', 'ap-southeast-2', 'ap-northeast-1',
'sa-east-1');

/**
* Constructor
*
* @param null $accessKey Override the default Access Key
* @param null $secretKey Override the default Secret Key
* @param null $region Sets the AWS Region
* @param HttpClient $httpClient Override the default HTTP Client
* @param null $accessKey Override the default Access Key
* @param null $secretKey Override the default Secret Key
* @param null $region Sets the AWS Region
* @param HttpClient $httpClient Override the default HTTP Client
* @throws Exception\InvalidArgumentException
*/
public function __construct($accessKey = null, $secretKey = null, $region = null, HttpClient $httpClient = null)
Expand All @@ -89,12 +89,12 @@ public function __construct($accessKey = null, $secretKey = null, $region = null
* Set which region you are working in. It will append the
* end point automatically
*
* @param string $region
* @param string $region
* @throws Exception\InvalidArgumentException
*/
public function setRegion($region)
{
if(in_array(strtolower($region), self::$_validEc2Regions, true)) {
if (in_array(strtolower($region), self::$_validEc2Regions, true)) {
$this->_region = $region;
} else {
throw new Exception\InvalidArgumentException('Invalid Amazon Ec2 Region');
Expand All @@ -114,7 +114,7 @@ protected function _getRegion()
/**
* Sends a HTTP request to the queue service using Zend_Http_Client
*
* @param array $params List of parameters to send with the request
* @param array $params List of parameters to send with the request
* @return Response
* @throws Exception\RuntimeException
*/
Expand All @@ -139,7 +139,6 @@ protected function sendRequest(array $params = array())

$httpResponse = $request->send();


} catch (\Zend\Http\Client\Exception\ExceptionInterface $zhce) {
$message = 'Error in request to AWS service: ' . $zhce->getMessage();
throw new Exception\RuntimeException($message, $zhce->getCode(), $zhce);
Expand Down Expand Up @@ -196,7 +195,7 @@ protected function addRequiredParameters(array $parameters)
* values before constructing this string. Do not use any separator
* characters when appending strings.
*
* @param array $parameters the parameters for which to get the signature.
* @param array $parameters the parameters for which to get the signature.
*
* @return string the signed data.
*/
Expand All @@ -210,7 +209,7 @@ protected function signParameters(array $parameters)
unset($parameters['Signature']);

$arrData = array();
foreach($parameters as $key => $value) {
foreach ($parameters as $key => $value) {
$arrData[] = $key . '=' . str_replace("%7E", "~", rawurlencode($value));
}

Expand All @@ -224,7 +223,7 @@ protected function signParameters(array $parameters)
/**
* Checks for errors responses from Amazon
*
* @param Response $response the response object to check.
* @param Response $response the response object to check.
* @throws Exception\RuntimeException if one or more errors are
* returned from Amazon.
*/
Expand Down

0 comments on commit 3c96fe0

Please sign in to comment.