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

Commit 8702b36

Browse files
author
justmd5
committed
升级依赖,代码适配
1 parent 912a12c commit 8702b36

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/Core/API.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function __construct(Signature $signature, $classify, $filter)
5151
public function request($method, $params = [], $files = [])
5252
{
5353
$url = sprintf('%s/%s/%s_%s', self::BASE_API, $this->classify, $this->classify, strtolower($method));
54-
if (!collect($this->filter)->has(strtolower($method))) {
54+
if (!key_exists(strtolower($method),$this->filter)) {
5555
throw new NotFoundException(sprintf('the url %s can not found!please reaffirm', $url));
5656
}
5757
$factory = new ValidatorFactory(new Translator());

src/Core/CoreServiceProvider.php

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

1111
use Pimple\Container;
12+
use Hanson\Foundation\Foundation;
1213
use Pimple\ServiceProviderInterface;
1314

1415
class CoreServiceProvider implements ServiceProviderInterface
@@ -23,8 +24,8 @@ class CoreServiceProvider implements ServiceProviderInterface
2324
*/
2425
public function register(Container $pimple)
2526
{
26-
$pimple['signature'] = function ($pimple) {
27-
return new Signature($pimple['config']['appKey'], $pimple['config']['appSecret']);
27+
$pimple['signature'] = function (Foundation $pimple) {
28+
return new Signature($pimple->getConfig()['appKey'], $pimple->getConfig()['appSecret']);
2829
};
2930
}
3031
}

0 commit comments

Comments
 (0)