ExtensionServiceProvider.php 934 B

123456789101112131415161718192021222324252627282930313233343536373839
  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\Kernel\Providers;
  11. use EasyWeChatComposer\Extension;
  12. use Pimple\Container;
  13. use Pimple\ServiceProviderInterface;
  14. /**
  15. * Class ExtensionServiceProvider.
  16. *
  17. * @author overtrue <i@overtrue.me>
  18. */
  19. class ExtensionServiceProvider implements ServiceProviderInterface
  20. {
  21. /**
  22. * Registers services on the given container.
  23. *
  24. * This method should only be used to configure services and parameters.
  25. * It should not get services.
  26. *
  27. * @param Container $pimple A container instance
  28. */
  29. public function register(Container $pimple)
  30. {
  31. !isset($pimple['extension']) && $pimple['extension'] = function ($app) {
  32. return new Extension($app);
  33. };
  34. }
  35. }