| @@ 31-50 (lines=20) @@ | ||
| 28 | /** |
|
| 29 | * Class JsServiceProvider. |
|
| 30 | */ |
|
| 31 | class CardServiceProvider implements ServiceProviderInterface |
|
| 32 | { |
|
| 33 | /** |
|
| 34 | * Registers services on the given container. |
|
| 35 | * |
|
| 36 | * This method should only be used to configure services and parameters. |
|
| 37 | * It should not get services. |
|
| 38 | * |
|
| 39 | * @param Container $pimple A container instance |
|
| 40 | */ |
|
| 41 | public function register(Container $pimple) |
|
| 42 | { |
|
| 43 | $pimple['card'] = function ($pimple) { |
|
| 44 | $card = new Card($pimple['access_token']); |
|
| 45 | $card->setCache($pimple['cache']); |
|
| 46 | ||
| 47 | return $card; |
|
| 48 | }; |
|
| 49 | } |
|
| 50 | } |
|
| 51 | ||
| @@ 31-50 (lines=20) @@ | ||
| 28 | /** |
|
| 29 | * Class JsServiceProvider. |
|
| 30 | */ |
|
| 31 | class JsServiceProvider implements ServiceProviderInterface |
|
| 32 | { |
|
| 33 | /** |
|
| 34 | * Registers services on the given container. |
|
| 35 | * |
|
| 36 | * This method should only be used to configure services and parameters. |
|
| 37 | * It should not get services. |
|
| 38 | * |
|
| 39 | * @param Container $pimple A container instance |
|
| 40 | */ |
|
| 41 | public function register(Container $pimple) |
|
| 42 | { |
|
| 43 | $pimple['js'] = function ($pimple) { |
|
| 44 | $js = new Js($pimple['access_token']); |
|
| 45 | $js->setCache($pimple['cache']); |
|
| 46 | ||
| 47 | return $js; |
|
| 48 | }; |
|
| 49 | } |
|
| 50 | } |
|
| 51 | ||