作者 竞泽

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
@@ -52,7 +55,7 @@ class TiktokShop @@ -52,7 +55,7 @@ class TiktokShop
52 } 55 }
53 56
54 /** 57 /**
55 - * @param array $options 58 + * @param array $options
56 * 59 *
57 * @return Config 60 * @return Config
58 */ 61 */
@@ -62,13 +65,13 @@ class TiktokShop @@ -62,13 +65,13 @@ 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 }
69 72
70 /** 73 /**
71 - * @param Config $config 74 + * @param Config $config
72 * 75 *
73 * @return TiktokShop 76 * @return TiktokShop
74 */ 77 */
@@ -78,18 +81,20 @@ class TiktokShop @@ -78,18 +81,20 @@ class TiktokShop
78 } 81 }
79 82
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 /**
91 * @param $name 96 * @param $name
92 - * @param array $arguments 97 + * @param array $arguments
93 * 98 *
94 * @return PassageProxy 99 * @return PassageProxy
95 */ 100 */
@@ -13,4 +13,4 @@ class FetchTest extends \PHPUnit\Framework\TestCase @@ -13,4 +13,4 @@ class FetchTest extends \PHPUnit\Framework\TestCase
13 13
14 $this->assertInstanceOf($obj, ResultSet::class); 14 $this->assertInstanceOf($obj, ResultSet::class);
15 } 15 }
16 -}  
  16 +}