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

Commit 59854c4

Browse files
authored
Merge pull request #56 from keithbrink/analysis-jLbMmR
Apply fixes from StyleCI
2 parents ce0c07d + d2d844a commit 59854c4

File tree

2 files changed

+68
-68
lines changed

2 files changed

+68
-68
lines changed

src/AmazonCore.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ protected function __construct($s, $mock = false, $m = null, $config = null)
163163
$this->setConfig($config);
164164
}
165165

166-
$this->env = __DIR__ . '/environment.php';
166+
$this->env = __DIR__.'/environment.php';
167167
$this->options['SignatureVersion'] = 2;
168168
$this->options['SignatureMethod'] = 'HmacSHA256';
169169
}
@@ -252,13 +252,13 @@ protected function fetchMockFile($load = true)
252252
) {
253253
$url = $this->mockFiles[$this->mockIndex];
254254
} else {
255-
$url = __DIR__ . '/../tests/mocks/' . $this->mockFiles[$this->mockIndex];
255+
$url = __DIR__.'/../tests/mocks/'.$this->mockFiles[$this->mockIndex];
256256
}
257257
$this->mockIndex++;
258258

259259
if (file_exists($url)) {
260260
try {
261-
$this->log('Fetched Mock File: ' . basename($url));
261+
$this->log('Fetched Mock File: '.basename($url));
262262
if ($load) {
263263
$return = simplexml_load_file($url);
264264
} else {
@@ -267,7 +267,7 @@ protected function fetchMockFile($load = true)
267267

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

272272
return false;
273273
}
@@ -361,15 +361,15 @@ protected function fetchMockResponse()
361361
<ErrorResponse xmlns="http://mws.amazonaws.com/doc/2009-01-01/">
362362
<Error>
363363
<Type>Sender</Type>
364-
<Code>' . $r['error'] . '</Code>
365-
<Message>' . $r['answer'] . '</Message>
364+
<Code>'.$r['error'].'</Code>
365+
<Message>'.$r['answer'].'</Message>
366366
</Error>
367367
<RequestID>123</RequestID>
368368
</ErrorResponse>';
369369
}
370370

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

374374
$this->rawResponses[] = $r;
375375

@@ -398,7 +398,7 @@ protected function checkResponse($r)
398398
} else {
399399
$xml = simplexml_load_string($r['body'])->Error;
400400
$this->log(
401-
'Bad Response! ' . $r['code'] . ' ' . $r['error'] . ': ' . $xml->Code . ' - ' . $xml->Message,
401+
'Bad Response! '.$r['code'].' '.$r['error'].': '.$xml->Code.' - '.$xml->Message,
402402
'Urgent'
403403
);
404404

@@ -638,12 +638,12 @@ protected function genQuery()
638638
*/
639639
protected function sendRequest($url, $param)
640640
{
641-
$this->log('Making request to Amazon: ' . $this->options['Action']);
641+
$this->log('Making request to Amazon: '.$this->options['Action']);
642642
$this->throttleCount = 0;
643643
$response = $this->fetchURL($url, $param);
644644

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

648648
return;
649649
}
@@ -748,7 +748,7 @@ protected function sleep()
748748
{
749749
flush();
750750
$s = ($this->throttleTime == 1) ? '' : 's';
751-
$this->log('Request was throttled, Sleeping for ' . $this->throttleTime . " second$s", 'Throttle');
751+
$this->log('Request was throttled, Sleeping for '.$this->throttleTime." second$s", 'Throttle');
752752
sleep($this->throttleTime);
753753
}
754754

@@ -900,7 +900,7 @@ protected function _getParametersAsString(array $parameters)
900900
{
901901
$queryParameters = [];
902902
foreach ($parameters as $key => $value) {
903-
$queryParameters[] = $key . '=' . $this->_urlencode($value);
903+
$queryParameters[] = $key.'='.$this->_urlencode($value);
904904
}
905905

906906
return implode('&', $queryParameters);
@@ -939,7 +939,7 @@ protected function _calculateStringToSignV2(array $parameters)
939939
{
940940
$data = 'POST';
941941
$data .= "\n";
942-
$endpoint = parse_url($this->urlbase . $this->urlbranch);
942+
$endpoint = parse_url($this->urlbase.$this->urlbranch);
943943
$data .= $endpoint['host'];
944944
$data .= "\n";
945945
$uri = array_key_exists('path', $endpoint) ? $endpoint['path'] : null;

0 commit comments

Comments
 (0)