Skip to content

Commit bffdc50

Browse files
committed
2 parents 7ddcbbc + 2d4dd1e commit bffdc50

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/Providers/Kuaidi100.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public function order($no, $company = null)
9494

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

97-
if(!\is_array($response)){
97+
if (!\is_array($response)) {
9898
$response = \json_decode($response, true);
9999
}
100100

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

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

109109
$this->company = $company;
@@ -136,6 +136,7 @@ public function getProviderName()
136136
* @param array $headers
137137
*
138138
* @return array
139+
*
139140
* @throws \Finecho\Logistics\Exceptions\HttpException
140141
*/
141142
protected function sendRequestGet($url, $params, $headers)
@@ -156,6 +157,7 @@ protected function sendRequestGet($url, $params, $headers)
156157
* @param int $SUCCESS_STATUS
157158
*
158159
* @return array
160+
*
159161
* @throws \Finecho\Logistics\Exceptions\HttpException
160162
* @throws \Finecho\Logistics\Exceptions\InquiryErrorException
161163
*/
@@ -167,7 +169,7 @@ protected function sendRequestPost($url, $params, $headers, $SUCCESS_STATUS = se
167169
throw new HttpException($e->getMessage(), $e->getCode(), $e);
168170
}
169171

170-
if(!\is_array($result)){
172+
if (!\is_array($result)) {
171173
$result = \json_decode($result, true);
172174
}
173175

@@ -229,6 +231,6 @@ protected function resetList($list)
229231
*/
230232
protected function generateSign($param, $key, $customer)
231233
{
232-
return \strtoupper(\md5(\json_encode($param) . $key . $customer));
234+
return \strtoupper(\md5(\json_encode($param).$key.$customer));
233235
}
234236
}

tests/Providers/Kuaidi100ProviderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function testGetLogisticsInfo()
3434
'kuaidi100' => [
3535
'app_code' => 'xxxxxxx',
3636
'customer' => 'xxxxxxx',
37-
],];
37+
], ];
3838

3939
$response = [
4040
'msg' => 'OK',
@@ -45,7 +45,7 @@ public function testGetLogisticsInfo()
4545
'courierPhone' => '',
4646
];
4747

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

5050
$params = [
5151
'customer' => 'xxxxxxx',

0 commit comments

Comments
 (0)