Skip to content

Commit

Permalink
Merge pull request #16 from finecho/analysis-XlxxPQ
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
thisliu authored May 27, 2019
2 parents 23f7218 + ff3fc58 commit 2d4dd1e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions src/Providers/Kuaidi100.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public function order($no, $company = null)

$response = $this->sendRequestGet(self::LOGISTICS_COM_CODE_URL, $query, []);

if(!\is_array($response)){
if (!\is_array($response)) {
$response = \json_decode($response, true);
}

Expand All @@ -103,7 +103,7 @@ public function order($no, $company = null)
}

$param['com'] = \current($response)['comCode'];
}else{
} else {
$param['com'] = $this->getLogisticsCompanyAliases($company);

$this->company = $company;
Expand Down Expand Up @@ -136,6 +136,7 @@ public function getProviderName()
* @param array $headers
*
* @return array
*
* @throws \Finecho\Logistics\Exceptions\HttpException
*/
protected function sendRequestGet($url, $params, $headers)
Expand All @@ -156,6 +157,7 @@ protected function sendRequestGet($url, $params, $headers)
* @param int $SUCCESS_STATUS
*
* @return array
*
* @throws \Finecho\Logistics\Exceptions\HttpException
* @throws \Finecho\Logistics\Exceptions\InquiryErrorException
*/
Expand All @@ -167,7 +169,7 @@ protected function sendRequestPost($url, $params, $headers, $SUCCESS_STATUS = se
throw new HttpException($e->getMessage(), $e->getCode(), $e);
}

if(!\is_array($result)){
if (!\is_array($result)) {
$result = \json_decode($result, true);
}

Expand Down Expand Up @@ -229,6 +231,6 @@ protected function resetList($list)
*/
protected function generateSign($param, $key, $customer)
{
return \strtoupper(\md5(\json_encode($param) . $key . $customer));
return \strtoupper(\md5(\json_encode($param).$key.$customer));
}
}
4 changes: 2 additions & 2 deletions tests/Providers/Kuaidi100ProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function testGetLogisticsInfo()
'kuaidi100' => [
'app_code' => 'xxxxxxx',
'customer' => 'xxxxxxx',
],];
], ];

$response = [
'msg' => 'OK',
Expand All @@ -45,7 +45,7 @@ public function testGetLogisticsInfo()
'courierPhone' => '',
];

$kuaidi100 = \Mockery::mock(Kuaidi100::class . '[post]', [$config])->shouldAllowMockingProtectedMethods();
$kuaidi100 = \Mockery::mock(Kuaidi100::class.'[post]', [$config])->shouldAllowMockingProtectedMethods();

$params = [
'customer' => 'xxxxxxx',
Expand Down

0 comments on commit 2d4dd1e

Please sign in to comment.