Skip to content

Commit

Permalink
Apply fixes from StyleCI (#248)
Browse files Browse the repository at this point in the history
[ci skip] [skip ci]
  • Loading branch information
overtrue authored Mar 17, 2020
1 parent 3d7505b commit dae4137
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 12 deletions.
9 changes: 7 additions & 2 deletions src/Gateways/HuaweiGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,12 @@ protected function buildWsseHeader($appKey, $appSecret)
$nonce = uniqid();
$passwordDigest = base64_encode(hash('sha256', ($nonce.$now.$appSecret)));

return sprintf('UsernameToken Username="%s",PasswordDigest="%s",Nonce="%s",Created="%s"',
$appKey, $passwordDigest, $nonce, $now);
return sprintf(
'UsernameToken Username="%s",PasswordDigest="%s",Nonce="%s",Created="%s"',
$appKey,
$passwordDigest,
$nonce,
$now
);
}
}
14 changes: 7 additions & 7 deletions src/Gateways/UcloudGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ class UcloudGateway extends Gateway
const SUCCESS_CODE = 0;

/**
* Send Message
* Send Message.
*
* @param PhoneNumberInterface $to
* @param MessageInterface $message
* @param Config $config
* @param PhoneNumberInterface $to
* @param MessageInterface $message
* @param Config $config
*
* @return array
*
Expand All @@ -57,9 +57,9 @@ public function send(PhoneNumberInterface $to, MessageInterface $message, Config
/**
* Build Params.
*
* @param PhoneNumberInterface $to
* @param MessageInterface $message
* @param Config $config
* @param PhoneNumberInterface $to
* @param MessageInterface $message
* @param Config $config
*
* @return array
*/
Expand Down
6 changes: 4 additions & 2 deletions tests/Gateways/HuaweiGatewayTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ public function testSend()
$gateway = \Mockery::mock(HuaweiGateway::class.'[request]', [$config])->shouldAllowMockingProtectedMethods();

$gateway->shouldReceive('request')
->with('post',
->with(
'post',
\Mockery::on(function ($endpoint) use ($config) {
return $config['endpoint'].'/sms/batchSendSms/v1' === $endpoint;
}),
Expand Down Expand Up @@ -107,7 +108,8 @@ public function testMultiFrom()
$gateway = \Mockery::mock(HuaweiGateway::class.'[request]', [$config])->shouldAllowMockingProtectedMethods();

$gateway->shouldReceive('request')
->with('post',
->with(
'post',
\Mockery::on(function ($endpoint) use ($config) {
return $config['endpoint'].'/sms/batchSendSms/v1' === $endpoint;
}),
Expand Down
3 changes: 2 additions & 1 deletion tests/Gateways/YunzhixunGatewayTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,8 @@ public function testExecute()
[
'code' => 100001,
'mock-error-msg',
], [
],
[
'code' => YunzhixunGateway::SUCCESS_CODE,
'msg' => 'mock-success-msg',
]
Expand Down

0 comments on commit dae4137

Please sign in to comment.