ServiceProvider.php 715 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. /*
  3. * This file is part of the overtrue/wechat.
  4. *
  5. * (c) overtrue <i@overtrue.me>
  6. *
  7. * This source file is subject to the MIT license that is bundled
  8. * with this source code in the file LICENSE.
  9. */
  10. namespace EasyWeChat\MiniProgram\Auth;
  11. use Pimple\Container;
  12. use Pimple\ServiceProviderInterface;
  13. class ServiceProvider implements ServiceProviderInterface
  14. {
  15. /**
  16. * {@inheritdoc}.
  17. */
  18. public function register(Container $app)
  19. {
  20. !isset($app['access_token']) && $app['access_token'] = function ($app) {
  21. return new AccessToken($app);
  22. };
  23. !isset($app['auth']) && $app['auth'] = function ($app) {
  24. return new Client($app);
  25. };
  26. }
  27. }