提交 a6f99212 编写于 作者: O overtrue

Fix function name.

上级 bc7cf637
...@@ -76,6 +76,9 @@ class EasySms ...@@ -76,6 +76,9 @@ class EasySms
* @param array $gateways * @param array $gateways
* *
* @return array * @return array
*
* @throws \Overtrue\EasySms\Exceptions\InvalidArgumentException
* @throws \Overtrue\EasySms\Exceptions\NoGatewayAvailableException
*/ */
public function send($to, $message, array $gateways = []) public function send($to, $message, array $gateways = [])
{ {
...@@ -88,6 +91,8 @@ class EasySms ...@@ -88,6 +91,8 @@ class EasySms
* @param string|null $name * @param string|null $name
* *
* @return \Overtrue\EasySms\Contracts\GatewayInterface * @return \Overtrue\EasySms\Contracts\GatewayInterface
*
* @throws \Overtrue\EasySms\Exceptions\InvalidArgumentException
*/ */
public function gateway($name = null) public function gateway($name = null)
{ {
...@@ -158,7 +163,7 @@ class EasySms ...@@ -158,7 +163,7 @@ class EasySms
* *
* @return string * @return string
* *
* @throws if no default gateway configured * @throws \RuntimeException if no default gateway configured
*/ */
public function getDefaultGateway() public function getDefaultGateway()
{ {
...@@ -199,6 +204,8 @@ class EasySms ...@@ -199,6 +204,8 @@ class EasySms
* @throws \InvalidArgumentException * @throws \InvalidArgumentException
* *
* @return GatewayInterface * @return GatewayInterface
*
* @throws \Overtrue\EasySms\Exceptions\InvalidArgumentException
*/ */
protected function createGateway($name) protected function createGateway($name)
{ {
...@@ -223,6 +230,8 @@ class EasySms ...@@ -223,6 +230,8 @@ class EasySms
* @param array $config * @param array $config
* *
* @return \Overtrue\EasySms\Contracts\GatewayInterface * @return \Overtrue\EasySms\Contracts\GatewayInterface
*
* @throws \Overtrue\EasySms\Exceptions\InvalidArgumentException
*/ */
protected function makeGateway($gateway, $config) protected function makeGateway($gateway, $config)
{ {
......
...@@ -66,7 +66,7 @@ class QcloudGateway extends Gateway ...@@ -66,7 +66,7 @@ class QcloudGateway extends Gateway
'ext' => '', 'ext' => '',
]; ];
$random = str_random(10); $random = substr(uniqid(), -10);
$params['sig'] = $this->generateSign($params, $random); $params['sig'] = $this->generateSign($params, $random);
......
...@@ -11,11 +11,11 @@ ...@@ -11,11 +11,11 @@
namespace Overtrue\EasySms\Gateways; namespace Overtrue\EasySms\Gateways;
use GuzzleHttp\Exception\ClientException;
use Overtrue\EasySms\Contracts\MessageInterface; use Overtrue\EasySms\Contracts\MessageInterface;
use Overtrue\EasySms\Exceptions\GatewayErrorException; use Overtrue\EasySms\Exceptions\GatewayErrorException;
use Overtrue\EasySms\Support\Config; use Overtrue\EasySms\Support\Config;
use Overtrue\EasySms\Traits\HasHttpRequest; use Overtrue\EasySms\Traits\HasHttpRequest;
use GuzzleHttp\Exception\ClientException;
/** /**
* Class TwilioGateway. * Class TwilioGateway.
......
...@@ -21,7 +21,7 @@ class QcloudGatewayTest extends TestCase ...@@ -21,7 +21,7 @@ class QcloudGatewayTest extends TestCase
{ {
public function testGetName() public function testGetName()
{ {
$this->assertSame('tencent', (new QcloudGateway([]))->getName()); $this->assertSame('qcloud', (new QcloudGateway([]))->getName());
} }
public function testSend() public function testSend()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册