ServiceProvider.php 687 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /**
  3. * This file is part of the apiadmin/tiktok.
  4. */
  5. namespace App\Libs\TikTok\OpenPlatform\Auth;
  6. use Pimple\Container;
  7. use Pimple\ServiceProviderInterface;
  8. /**
  9. * Class ServiceProvider.
  10. *
  11. * @author zhaoxiang <zhaoxiang051405@gmail.com>
  12. */
  13. class ServiceProvider implements ServiceProviderInterface {
  14. /**
  15. * {@inheritdoc}.
  16. */
  17. public function register(Container $pimple): void {
  18. !isset($pimple['access_token']) && $pimple['access_token'] = static function($app) {
  19. return new AccessToken($app);
  20. };
  21. !isset($pimple['auth']) && $pimple['auth'] = static function($app) {
  22. return new Client($app);
  23. };
  24. }
  25. }