Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

Commit

Permalink
Merge pull request #63 from keithbrink/analysis-x0y530
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
keithbrink authored Jan 21, 2022
2 parents ef3a5ed + 6e01104 commit 0fd95e4
Show file tree
Hide file tree
Showing 23 changed files with 120 additions and 120 deletions.
26 changes: 13 additions & 13 deletions src/AmazonCore.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ protected function __construct($s, $mock = false, $m = null, $config = null)
$this->setConfig($config);
}

$this->env = __DIR__ . '/environment.php';
$this->env = __DIR__.'/environment.php';
$this->options['SignatureVersion'] = 2;
$this->options['SignatureMethod'] = 'HmacSHA256';
}
Expand Down Expand Up @@ -255,13 +255,13 @@ protected function fetchMockFile($load = true)
) {
$url = $this->mockFiles[$this->mockIndex];
} else {
$url = __DIR__ . '/../tests/mocks/' . $this->mockFiles[$this->mockIndex];
$url = __DIR__.'/../tests/mocks/'.$this->mockFiles[$this->mockIndex];
}
$this->mockIndex++;

if (file_exists($url)) {
try {
$this->log('Fetched Mock File: ' . basename($url));
$this->log('Fetched Mock File: '.basename($url));
if ($load) {
$return = simplexml_load_file($url);
} else {
Expand All @@ -270,7 +270,7 @@ protected function fetchMockFile($load = true)

return $return;
} catch (\Exception $e) {
$this->log("Error when opening Mock File: $url - " . $e->getMessage(), 'Warning');
$this->log("Error when opening Mock File: $url - ".$e->getMessage(), 'Warning');

return false;
}
Expand Down Expand Up @@ -366,15 +366,15 @@ protected function fetchMockResponse()
<ErrorResponse xmlns="http://mws.amazonaws.com/doc/2009-01-01/">
<Error>
<Type>Sender</Type>
<Code>' . $r['error'] . '</Code>
<Message>' . $r['answer'] . '</Message>
<Code>'.$r['error'].'</Code>
<Message>'.$r['answer'].'</Message>
</Error>
<RequestID>123</RequestID>
</ErrorResponse>';
}

$r['headarray'] = [];
$this->log('Returning Mock Response: ' . $r['code']);
$this->log('Returning Mock Response: '.$r['code']);

$this->rawResponses[] = $r;

Expand Down Expand Up @@ -403,7 +403,7 @@ protected function checkResponse($r)
} else {
$xml = simplexml_load_string($r['body'])->Error;
$this->log(
'Bad Response! ' . $r['code'] . ' ' . $r['error'] . ': ' . $xml->Code . ' - ' . $xml->Message,
'Bad Response! '.$r['code'].' '.$r['error'].': '.$xml->Code.' - '.$xml->Message,
'Urgent'
);

Expand Down Expand Up @@ -643,12 +643,12 @@ protected function genQuery()
*/
protected function sendRequest($url, $param)
{
$this->log('Making request to Amazon: ' . $this->options['Action']);
$this->log('Making request to Amazon: '.$this->options['Action']);
$this->throttleCount = 0;
$response = $this->fetchURL($url, $param);

if (! isset($response['code']) || ! array_key_exists('code', $response)) {
$this->log('Unrecognized response: ' . print_r($response, true));
$this->log('Unrecognized response: '.print_r($response, true));

return;
}
Expand Down Expand Up @@ -755,7 +755,7 @@ protected function sleep()
{
flush();
$s = ($this->throttleTime == 1) ? '' : 's';
$this->log('Request was throttled, Sleeping for ' . $this->throttleTime . " second$s", 'Throttle');
$this->log('Request was throttled, Sleeping for '.$this->throttleTime." second$s", 'Throttle');
sleep($this->throttleTime);
}

Expand Down Expand Up @@ -911,7 +911,7 @@ protected function _getParametersAsString(array $parameters)
{
$queryParameters = [];
foreach ($parameters as $key => $value) {
$queryParameters[] = $key . '=' . $this->_urlencode($value);
$queryParameters[] = $key.'='.$this->_urlencode($value);
}

return implode('&', $queryParameters);
Expand Down Expand Up @@ -950,7 +950,7 @@ protected function _calculateStringToSignV2(array $parameters)
{
$data = 'POST';
$data .= "\n";
$endpoint = parse_url($this->urlbase . $this->urlbranch);
$endpoint = parse_url($this->urlbase.$this->urlbranch);
$data .= $endpoint['host'];
$data .= "\n";
$uri = array_key_exists('path', $endpoint) ? $endpoint['path'] : null;
Expand Down
18 changes: 9 additions & 9 deletions src/AmazonFeedList.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public function setFeedIds($s)
$this->resetFeedIds();
$i = 1;
foreach ($s as $x) {
$this->options['FeedSubmissionIdList.Id.' . $i] = $x;
$this->options['FeedSubmissionIdList.Id.'.$i] = $x;
$i++;
}
} else {
Expand Down Expand Up @@ -162,7 +162,7 @@ public function setFeedTypes($s)
$this->resetFeedTypes();
$i = 1;
foreach ($s as $x) {
$this->options['FeedTypeList.Type.' . $i] = $x;
$this->options['FeedTypeList.Type.'.$i] = $x;
$i++;
}
} else {
Expand Down Expand Up @@ -206,7 +206,7 @@ public function setFeedStatuses($s)
$this->resetFeedStatuses();
$i = 1;
foreach ($s as $x) {
$this->options['FeedProcessingStatusList.Status.' . $i] = $x;
$this->options['FeedProcessingStatusList.Status.'.$i] = $x;
$i++;
}
} else {
Expand Down Expand Up @@ -298,11 +298,11 @@ public function fetchFeedSubmissions($r = true)
{
$this->prepareToken();

$url = $this->urlbase . $this->urlbranch;
$url = $this->urlbase.$this->urlbranch;

$query = $this->genQuery();

$path = $this->options['Action'] . 'Result';
$path = $this->options['Action'].'Result';
if ($this->mockMode) {
$xml = $this->fetchMockFile()->$path;
} else {
Expand Down Expand Up @@ -411,11 +411,11 @@ public function countFeeds()
{
$this->prepareCount();

$url = $this->urlbase . $this->urlbranch;
$url = $this->urlbase.$this->urlbranch;

$query = $this->genQuery();

$path = $this->options['Action'] . 'Result';
$path = $this->options['Action'].'Result';
if ($this->mockMode) {
$xml = $this->fetchMockFile()->$path;
} else {
Expand Down Expand Up @@ -470,11 +470,11 @@ public function cancelFeeds()
{
$this->prepareCancel();

$url = $this->urlbase . $this->urlbranch;
$url = $this->urlbase.$this->urlbranch;

$query = $this->genQuery();

$path = $this->options['Action'] . 'Result';
$path = $this->options['Action'].'Result';
if ($this->mockMode) {
$xml = $this->fetchMockFile()->$path;
} else {
Expand Down
4 changes: 2 additions & 2 deletions src/AmazonFinancialGroupList.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,11 @@ public function fetchGroupList($r = true)

$this->prepareToken();

$url = $this->urlbase . $this->urlbranch;
$url = $this->urlbase.$this->urlbranch;

$query = $this->genQuery();

$path = $this->options['Action'] . 'Result';
$path = $this->options['Action'].'Result';

if ($this->mockMode) {
$xml = $this->fetchMockFile()->$path;
Expand Down
4 changes: 2 additions & 2 deletions src/AmazonFulfillmentOrderList.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,11 @@ public function fetchOrderList($r = true)
{
$this->prepareToken();

$url = $this->urlbase . $this->urlbranch;
$url = $this->urlbase.$this->urlbranch;

$query = $this->genQuery();

$path = $this->options['Action'] . 'Result';
$path = $this->options['Action'].'Result';

if ($this->mockMode) {
$xml = $this->fetchMockFile()->$path;
Expand Down
6 changes: 3 additions & 3 deletions src/AmazonInventoryList.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public function setSellerSkus($a)
$this->resetSkus();
$i = 1;
foreach ($a as $x) {
$this->options['SellerSkus.member.' . $i] = $x;
$this->options['SellerSkus.member.'.$i] = $x;
$i++;
}
} else {
Expand Down Expand Up @@ -192,11 +192,11 @@ public function fetchInventoryList($r = true)
}
$this->prepareToken();

$url = $this->urlbase . $this->urlbranch;
$url = $this->urlbase.$this->urlbranch;

$query = $this->genQuery();

$path = $this->options['Action'] . 'Result';
$path = $this->options['Action'].'Result';

if ($this->mockMode) {
$xml = $this->fetchMockFile()->$path;
Expand Down
12 changes: 6 additions & 6 deletions src/AmazonMerchantServiceList.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ public function setItems($a)
$i = 1;
foreach ($a as $x) {
if (is_array($x) && isset($x['OrderItemId']) && isset($x['Quantity'])) {
$this->options['ShipmentRequestDetails.ItemList.Item.' . $i . '.OrderItemId'] = $x['OrderItemId'];
$this->options['ShipmentRequestDetails.ItemList.Item.' . $i . '.Quantity'] = $x['Quantity'];
$this->options['ShipmentRequestDetails.ItemList.Item.'.$i.'.OrderItemId'] = $x['OrderItemId'];
$this->options['ShipmentRequestDetails.ItemList.Item.'.$i.'.Quantity'] = $x['Quantity'];
$i++;
} else {
$this->resetItems();
Expand Down Expand Up @@ -376,7 +376,7 @@ public function setMaxArrivalDate($d)
$this->options['ShipmentRequestDetails.MustArriveByDate'] = $this->genTime($d);
} catch (Exception $e) {
unset($this->options['ShipmentRequestDetails.MustArriveByDate']);
$this->log('Error: ' . $e->getMessage(), 'Warning');
$this->log('Error: '.$e->getMessage(), 'Warning');

return false;
}
Expand All @@ -396,7 +396,7 @@ public function setShipDate($d)
$this->options['ShipmentRequestDetails.ShipDate'] = $this->genTime($d);
} catch (Exception $e) {
unset($this->options['ShipmentRequestDetails.ShipDate']);
$this->log('Error: ' . $e->getMessage(), 'Warning');
$this->log('Error: '.$e->getMessage(), 'Warning');

return false;
}
Expand Down Expand Up @@ -553,11 +553,11 @@ public function fetchServices()
return false;
}

$url = $this->urlbase . $this->urlbranch;
$url = $this->urlbase.$this->urlbranch;

$query = $this->genQuery();

$path = $this->options['Action'] . 'Result';
$path = $this->options['Action'].'Result';
if ($this->mockMode) {
$xml = $this->fetchMockFile()->$path;
} else {
Expand Down
6 changes: 3 additions & 3 deletions src/AmazonOrderItemList.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,11 @@ public function fetchItems($r = true)
{
$this->prepareToken();

$url = $this->urlbase . $this->urlbranch;
$url = $this->urlbase.$this->urlbranch;

$query = $this->genQuery();

$path = $this->options['Action'] . 'Result';
$path = $this->options['Action'].'Result';
if ($this->mockMode) {
$xml = $this->fetchMockFile()->$path;
} else {
Expand All @@ -162,7 +162,7 @@ public function fetchItems($r = true)
} else {
if (isset($this->options['AmazonOrderId']) && $this->options['AmazonOrderId'] && $this->options['AmazonOrderId'] != $xml->AmazonOrderId) {
$this->log(
'You grabbed the wrong Order\'s items! - ' . $this->options['AmazonOrderId'] . ' =/= ' . $xml->AmazonOrderId,
'You grabbed the wrong Order\'s items! - '.$this->options['AmazonOrderId'].' =/= '.$xml->AmazonOrderId,
'Urgent'
);
}
Expand Down
12 changes: 6 additions & 6 deletions src/AmazonOrderList.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public function setLimits($mode, $lower = null, $upper = null)
$after = $this->genTime('- 2 min');
}
if ($after > $before) {
$after = $this->genTime($upper . ' - 150 sec');
$after = $this->genTime($upper.' - 150 sec');
}
if ($mode == 'Created') {
$this->options['CreatedAfter'] = $after;
Expand All @@ -163,7 +163,7 @@ public function setLimits($mode, $lower = null, $upper = null)
}
}
} catch (\Exception $e) {
$this->log('Error: ' . $e->getMessage(), 'Warning');
$this->log('Error: '.$e->getMessage(), 'Warning');

return false;
}
Expand Down Expand Up @@ -192,7 +192,7 @@ public function setOrderStatusFilter($list)
$this->resetOrderStatusFilter();
$i = 1;
foreach ($list as $x) {
$this->options['OrderStatus.Status.' . $i] = $x;
$this->options['OrderStatus.Status.'.$i] = $x;
$i++;
}
} else {
Expand Down Expand Up @@ -258,7 +258,7 @@ public function setPaymentMethodFilter($list)
$this->resetPaymentMethodFilter();
$i = 1;
foreach ($list as $x) {
$this->options['PaymentMethod.' . $i++] = $x;
$this->options['PaymentMethod.'.$i++] = $x;
}
} else {
return false;
Expand Down Expand Up @@ -383,11 +383,11 @@ public function fetchOrders($r = true)

$this->prepareToken();

$url = $this->urlbase . $this->urlbranch;
$url = $this->urlbase.$this->urlbranch;

$query = $this->genQuery();

$path = $this->options['Action'] . 'Result';
$path = $this->options['Action'].'Result';
if ($this->mockMode) {
$xml = $this->fetchMockFile()->$path;
} else {
Expand Down
6 changes: 3 additions & 3 deletions src/AmazonOrderSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function setOrderIds($o)
if (is_array($o)) {
$k = 1;
foreach ($o as $id) {
$this->options['AmazonOrderId.Id.' . $k] = $id;
$this->options['AmazonOrderId.Id.'.$k] = $id;
$k++;
}
} else {
Expand Down Expand Up @@ -136,11 +136,11 @@ public function fetchOrders()
return false;
}

$url = $this->urlbase . $this->urlbranch;
$url = $this->urlbase.$this->urlbranch;

$query = $this->genQuery();

$path = $this->options['Action'] . 'Result';
$path = $this->options['Action'].'Result';
if ($this->mockMode) {
$xml = $this->fetchMockFile()->$path;
} else {
Expand Down
8 changes: 4 additions & 4 deletions src/AmazonPrepInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function setSkus($s)
$this->resetSKUs();
$i = 1;
foreach ($s as $x) {
$this->options['SellerSKUList.Id.' . $i] = $x;
$this->options['SellerSKUList.Id.'.$i] = $x;
$i++;
}
} else {
Expand Down Expand Up @@ -120,7 +120,7 @@ public function setAsins($s)
$this->resetASINs();
$i = 1;
foreach ($s as $x) {
$this->options['ASINList.Id.' . $i] = $x;
$this->options['ASINList.Id.'.$i] = $x;
$i++;
}
} else {
Expand Down Expand Up @@ -173,11 +173,11 @@ public function fetchPrepInstructions()

$this->preparePrep();

$url = $this->urlbase . $this->urlbranch;
$url = $this->urlbase.$this->urlbranch;

$query = $this->genQuery();

$path = $this->options['Action'] . 'Result';
$path = $this->options['Action'].'Result';
if ($this->mockMode) {
$xml = $this->fetchMockFile();
} else {
Expand Down
Loading

0 comments on commit 0fd95e4

Please sign in to comment.