Skip to content
This repository was archived by the owner on Jun 29, 2022. It is now read-only.

Commit 91b2072

Browse files
justmd5StyleCIBot
authored andcommitted
Apply fixes from StyleCI
1 parent 3951241 commit 91b2072

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/Core/API.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
namespace Justmd5\TencentAi\Core;
1010

1111
use Hanson\Foundation\AbstractAPI;
12+
use Justmd5\TencentAi\Core\Traits\ArgumentProcessingTrait;
1213
use Justmd5\TencentAi\Exception\IllegalParameterException;
1314
use Justmd5\TencentAi\Exception\NotFoundException;
1415
use Overtrue\Validation\Factory as ValidatorFactory;
1516
use Overtrue\Validation\Translator;
16-
use Justmd5\TencentAi\Core\Traits\ArgumentProcessingTrait;
1717

1818
class API extends AbstractAPI
1919
{
@@ -43,13 +43,13 @@ public function __construct(Signature $signature, $classify, $filter)
4343
* 请求API.
4444
*
4545
* @param string $method
46-
* @param array $params
47-
* @param array $files
46+
* @param array $params
47+
* @param array $files
4848
*
49-
* @return array
5049
* @throws IllegalParameterException
51-
*
5250
* @throws NotFoundException
51+
*
52+
* @return array
5353
*/
5454
public function request($method, $params = [], $files = [])
5555
{
@@ -63,7 +63,7 @@ public function request($method, $params = [], $files = [])
6363
throw new IllegalParameterException(sprintf('参数错误:[%s]', json_encode($validator->errors(), JSON_UNESCAPED_UNICODE)));
6464
}
6565
$http = $this->getHttp();
66-
$params=$this->processParams($this->signature,$params);
66+
$params = $this->processParams($this->signature, $params);
6767
$response = $files ? $http->upload($url, $params, $files) : $http->post($url, $params);
6868
$result = json_decode(strval($response->getBody()), true);
6969
if (isset($result['ret'])) {

src/Core/Traits/ArgumentProcessingTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ trait ArgumentProcessingTrait
99
public function processParams(Signature $signature, $params)
1010
{
1111
if (empty($params['nonce_str'])) {
12-
$params['nonce_str'] = md5(uniqid("TencentAi_"));
12+
$params['nonce_str'] = md5(uniqid('TencentAi_'));
1313
}
1414
if (empty($params['time_stamp'])) {
1515
$params['time_stamp'] = strval(time());
@@ -21,4 +21,4 @@ public function processParams(Signature $signature, $params)
2121

2222
return $params;
2323
}
24-
}
24+
}

0 commit comments

Comments
 (0)