PluginProbe
SureCart – Ecommerce Made Easy For Selling Physical Products, Digital Downloads, Subscriptions, Donations, & Payments / 1.0.4
SureCart – Ecommerce Made Easy For Selling Physical Products, Digital Downloads, Subscriptions, Donations, & Payments v1.0.4
4.7.2 4.7.1 4.7.0 4.6.6 4.6.5 4.6.4 4.6.3 4.6.2 4.6.1 4.6.0 4.5.1 4.5.0 4.4.2 4.4.1 4.4.0 4.3.3 4.3.2 4.3.1 4.3.0 4.2.3 4.2.2 4.2.1 1.0.3 1.0.4 1.0.5 All 281 releases
surecart / app / src / Request / RequestServiceProvider.php
RequestServiceProvider.php
46 lines 946 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace SureCart\Request;
4
5 use SureCart\Models\ApiToken;
6 use SureCartCore\ServiceProviders\ServiceProviderInterface;
7
8 /**
9 * Handles the request service
10 */
11 class RequestServiceProvider implements ServiceProviderInterface {
12 /**
13 * {@inheritDoc}
14 *
15 * @param \Pimple\Container $container Service Container.
16 */
17 public function register( $container ) {
18 $app = $container[ SURECART_APPLICATION_KEY ];
19
20 $container['requests'] = function () {
21 return new RequestService( ApiToken::get() );
22 };
23
24 $app->alias( 'requests', 'requests' );
25
26 $app->alias(
27 'request',
28 function () use ( $app ) {
29 return call_user_func_array( [ $app->requests(), 'makeRequest' ], func_get_args() );
30 }
31 );
32 }
33
34 /**
35 * {@inheritDoc}
36 *
37 * @param \Pimple\Container $container Service Container.
38 *
39 * @return void
40 *
41 * phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter
42 */
43 public function bootstrap( $container ) {
44 }
45 }
46