HelpWidgetServiceProvider.php
41 lines
| 1 | <?php |
| 2 | |
| 3 | namespace SureCart\Integrations\HelpWidget; |
| 4 | |
| 5 | use SureCartCore\ServiceProviders\ServiceProviderInterface; |
| 6 | |
| 7 | /** |
| 8 | * Provides the Survey service provider. |
| 9 | */ |
| 10 | class HelpWidgetServiceProvider implements ServiceProviderInterface { |
| 11 | /** |
| 12 | * Register all dependencies in the IoC container. |
| 13 | * |
| 14 | * @param \Pimple\Container $container Service container. |
| 15 | * @return void |
| 16 | */ |
| 17 | public function register( $container ) { |
| 18 | $container['surecart.help_widget'] = function ( $container ) { |
| 19 | return new HelpWidget(); |
| 20 | }; |
| 21 | |
| 22 | $app = $container[ SURECART_APPLICATION_KEY ]; |
| 23 | |
| 24 | $app->alias( 'helpWidget', 'surecart.help_widget' ); |
| 25 | } |
| 26 | |
| 27 | /** |
| 28 | * {@inheritDoc} |
| 29 | * |
| 30 | * @param \Pimple\Container $container Service Container. |
| 31 | */ |
| 32 | public function bootstrap( $container ) { |
| 33 | // not connected. |
| 34 | if ( ! $container['surecart.account']->is_connected ) { |
| 35 | return; |
| 36 | } |
| 37 | |
| 38 | $container['surecart.help_widget']->bootstrap(); |
| 39 | } |
| 40 | } |
| 41 |