作者 竞泽

docs:doc link

@@ -9,6 +9,7 @@ use Lackoxygen\TiktokShop\Passage\Order\OrderInterface; @@ -9,6 +9,7 @@ use Lackoxygen\TiktokShop\Passage\Order\OrderInterface;
9 use Lackoxygen\TiktokShop\Passage\Product\ProductInterface; 9 use Lackoxygen\TiktokShop\Passage\Product\ProductInterface;
10 use Lackoxygen\TiktokShop\Passage\Shop\ShopInterface; 10 use Lackoxygen\TiktokShop\Passage\Shop\ShopInterface;
11 use Lackoxygen\TiktokShop\Passage\Verify; 11 use Lackoxygen\TiktokShop\Passage\Verify;
  12 +use Lackoxygen\TiktokShop\TiktokShop as TiktokShopKernel;
12 13
13 /** 14 /**
14 * @method static OrderInterface order() 15 * @method static OrderInterface order()
@@ -17,6 +18,7 @@ use Lackoxygen\TiktokShop\Passage\Verify; @@ -17,6 +18,7 @@ use Lackoxygen\TiktokShop\Passage\Verify;
17 * @method static Authorize authorize() 18 * @method static Authorize authorize()
18 * @method static Verify verify() 19 * @method static Verify verify()
19 * @method static Alliance alliance() 20 * @method static Alliance alliance()
  21 + * @method static TiktokShopKernel setAccessToken(string $accessToken)
20 */ 22 */
21 class TiktokShop extends Facade 23 class TiktokShop extends Facade
22 { 24 {
@@ -25,6 +27,6 @@ class TiktokShop extends Facade @@ -25,6 +27,6 @@ class TiktokShop extends Facade
25 */ 27 */
26 protected static function getFacadeAccessor(): string 28 protected static function getFacadeAccessor(): string
27 { 29 {
28 - return \Lackoxygen\TiktokShop\TiktokShop::class; 30 + return TiktokShopKernel::class;
29 } 31 }
30 } 32 }
@@ -31,8 +31,11 @@ class TiktokShop @@ -31,8 +31,11 @@ class TiktokShop
31 * @var array|string[] 31 * @var array|string[]
32 */ 32 */
33 protected static array $passages = [ 33 protected static array $passages = [
34 - 'order' => Passage\Order\Order::class, 'shop' => Passage\Shop\Shop::class,  
35 - 'product' => Passage\Product\Product::class, 'authorize' => Authorize::class, 'verify' => Verify::class, 34 + 'order' => Passage\Order\Order::class,
  35 + 'shop' => Passage\Shop\Shop::class,
  36 + 'product' => Passage\Product\Product::class,
  37 + 'authorize' => Authorize::class,
  38 + 'verify' => Verify::class,
36 'alliance' => Alliance::class 39 'alliance' => Alliance::class
37 ]; 40 ];
38 41
@@ -62,7 +65,7 @@ class TiktokShop @@ -62,7 +65,7 @@ class TiktokShop
62 Arr::get($options, 'app_key'), 65 Arr::get($options, 'app_key'),
63 Arr::get($options, 'app_secret'), 66 Arr::get($options, 'app_secret'),
64 Arr::get($options, 'base_uri'), 67 Arr::get($options, 'base_uri'),
65 - (float)Arr::get($options, 'timeout'), 68 + (float) Arr::get($options, 'timeout'),
66 Arr::get($options, 'enable_mock') 69 Arr::get($options, 'enable_mock')
67 ); 70 );
68 } 71 }
@@ -80,11 +83,13 @@ class TiktokShop @@ -80,11 +83,13 @@ class TiktokShop
80 /** 83 /**
81 * @param string $accessToken 84 * @param string $accessToken
82 * 85 *
83 - * @return void 86 + * @return $this
84 */ 87 */
85 - public function setAccessToken(string $accessToken): void 88 + public function setAccessToken(string $accessToken): TiktokShop
86 { 89 {
87 $this->config->setAccessToken($accessToken); 90 $this->config->setAccessToken($accessToken);
  91 +
  92 + return $this;
88 } 93 }
89 94
90 /** 95 /**