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

Commit 1f975b5

Browse files
justmd5justmd5
authored andcommitted
Apply fixes from StyleCI
1 parent 7de0d6e commit 1f975b5

File tree

3 files changed

+15
-16
lines changed

3 files changed

+15
-16
lines changed

src/Core/API.php

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,38 +34,37 @@ class API extends AbstractAPI
3434
public function __construct(Signature $signature, $classify, $filter)
3535
{
3636
$this->signature = $signature;
37-
$this->classify = $classify;
38-
$this->filter = $filter;
37+
$this->classify = $classify;
38+
$this->filter = $filter;
3939
}
4040

4141
/**
4242
* 请求API.
4343
*
4444
* @param string $method
45-
* @param array $params
46-
* @param array $files
45+
* @param array $params
46+
* @param array $files
4747
*
48-
* @return array
4948
* @throws NotFoundException
5049
* @throws IllegalParameterException
5150
*
52-
* @throws IllegalParameterException
51+
* @return array
5352
*/
5453
public function request($method, $params = [], $files = [])
5554
{
5655
$url = sprintf('%s/%s/%s_%s', self::BASE_API, $this->classify, $this->classify, strtolower($method));
5756
if (!array_key_exists(strtolower($method), $this->filter)) {
5857
throw new NotFoundException(sprintf('the url %s can not found!please reaffirm', $url));
5958
}
60-
$factory = new ValidatorFactory(new Translator());
59+
$factory = new ValidatorFactory(new Translator());
6160
$validator = $factory->make($params, $this->filter[$method]);
6261
if (!$validator->passes()) {
6362
throw new IllegalParameterException(sprintf('参数错误:[%s]', json_encode($validator->errors(), JSON_UNESCAPED_UNICODE)));
6463
}
65-
$http = $this->getHttp();
66-
$params = $this->processParams($this->signature, $params);
64+
$http = $this->getHttp();
65+
$params = $this->processParams($this->signature, $params);
6766
$response = $files ? $http->upload($url, $params, $files) : $http->post($url, $params);
68-
$result = json_decode(strval($response->getBody()), true);
67+
$result = json_decode(strval($response->getBody()), true);
6968
if (isset($result['ret'])) {
7069
return $result;
7170
}

src/Core/Signature.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class Signature
2727
*/
2828
public function __construct($appId, $secret)
2929
{
30-
$this->appId = $appId;
30+
$this->appId = $appId;
3131
$this->secret = $secret;
3232
}
3333

src/Core/Traits/FilterTrait.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ trait FilterTrait
2424
'tts' => [],
2525
'tta' => [],
2626
'detectkeyword' => [ //关键词检索
27-
'callback_url' => 'require|url',
28-
'speech' => 'required_without:speech_url',
29-
'speech_url' => 'required_without:speech',
30-
'key_words' => 'required',
31-
'format' => 'require|integer|in:1',
27+
'callback_url' => 'require|url',
28+
'speech' => 'required_without:speech_url',
29+
'speech_url' => 'required_without:speech',
30+
'key_words' => 'required',
31+
'format' => 'require|integer|in:1',
3232
],
3333
],
3434
'face' => [

0 commit comments

Comments
 (0)