|
27 | 27 |
|
28 | 28 | return array( |
29 | 29 |
|
30 | | - 'compat.ppec.mock-gateway' => static function ( $container ) { |
| 30 | + 'compat.ppec.mock-gateway' => static function ( $container ) { |
31 | 31 | $settings = $container->get( 'settings.settings-provider' ); |
32 | 32 | assert( $settings instanceof SettingsProvider ); |
33 | 33 |
|
|
40 | 40 | return new PPEC\MockGateway( $title ); |
41 | 41 | }, |
42 | 42 |
|
43 | | - 'compat.ppec.billing-agreement-converter' => static function ( ContainerInterface $container ) { |
| 43 | + 'compat.ppec.billing-agreement-converter' => static function ( ContainerInterface $container ) { |
44 | 44 | return new PPEC\BillingAgreementTokenConverter( |
45 | 45 | $container->get( 'api.endpoint.payment-method-tokens' ), |
46 | 46 | $container->get( 'api.repository.customer' ), |
47 | 47 | $container->get( 'woocommerce.logger.woocommerce' ) |
48 | 48 | ); |
49 | 49 | }, |
50 | 50 |
|
51 | | - 'compat.ppec.subscriptions-handler' => static function ( ContainerInterface $container ) { |
| 51 | + 'compat.ppec.subscriptions-handler' => static function ( ContainerInterface $container ) { |
52 | 52 | return new PPEC\SubscriptionsHandler( |
53 | 53 | $container->get( 'wc-subscriptions.renewal-handler' ), |
54 | 54 | $container->get( 'compat.ppec.mock-gateway' ), |
|
57 | 57 | ); |
58 | 58 | }, |
59 | 59 |
|
60 | | - 'compat.plugin-script-names' => static function ( ContainerInterface $container ): array { |
| 60 | + 'compat.plugin-script-names' => static function ( ContainerInterface $container ): array { |
61 | 61 | return array( |
62 | 62 | 'ppcp-smart-button', |
63 | 63 | 'ppcp-oxxo', |
|
71 | 71 | ); |
72 | 72 | }, |
73 | 73 |
|
74 | | - 'compat.plugin-script-file-names' => static function ( ContainerInterface $container ): array { |
| 74 | + 'compat.plugin-script-file-names' => static function ( ContainerInterface $container ): array { |
75 | 75 | return array( |
76 | 76 | 'button.js', |
77 | 77 | 'gateway-settings.js', |
|
81 | 81 | ); |
82 | 82 | }, |
83 | 83 |
|
84 | | - 'compat.shiptastic.is_supported_plugin_version_active' => function (): bool { |
| 84 | + 'compat.shiptastic.is_supported_plugin_version_active' => function (): bool { |
85 | 85 | return function_exists( 'wc_stc_get_shipments' ); |
86 | 86 | }, |
87 | 87 |
|
88 | 88 | 'compat.wc_shipment_tracking.is_supported_plugin_version_active' => function (): bool { |
89 | 89 | return class_exists( 'WC_Shipment_Tracking' ); |
90 | 90 | }, |
91 | 91 |
|
92 | | - 'compat.ywot.is_supported_plugin_version_active' => function (): bool { |
| 92 | + 'compat.ywot.is_supported_plugin_version_active' => function (): bool { |
93 | 93 | return function_exists( 'yith_ywot_init' ); |
94 | 94 | }, |
95 | | - 'compat.dhl.is_supported_plugin_version_active' => function (): bool { |
| 95 | + 'compat.dhl.is_supported_plugin_version_active' => function (): bool { |
96 | 96 | return function_exists( 'PR_DHL' ); |
97 | 97 | }, |
98 | 98 | 'compat.shipstation.is_supported_plugin_version_active' => function (): bool { |
|
101 | 101 | 'compat.wc_shipping_tax.is_supported_plugin_version_active' => function (): bool { |
102 | 102 | return class_exists( 'WC_Connect_Loader' ); |
103 | 103 | }, |
104 | | - 'compat.nyp.is_supported_plugin_version_active' => function (): bool { |
| 104 | + 'compat.nyp.is_supported_plugin_version_active' => function (): bool { |
105 | 105 | return function_exists( 'wc_nyp_init' ); |
106 | 106 | }, |
107 | 107 | 'compat.wc_bookings.is_supported_plugin_version_active' => function (): bool { |
108 | 108 | return class_exists( 'WC_Bookings' ); |
109 | 109 | }, |
110 | 110 |
|
111 | | - 'compat.asset_getter' => static function ( ContainerInterface $container ): AssetGetter { |
| 111 | + 'compat.asset_getter' => static function ( ContainerInterface $container ): AssetGetter { |
112 | 112 | $factory = $container->get( 'assets.asset_getter_factory' ); |
113 | 113 | assert( $factory instanceof AssetGetterFactory ); |
114 | 114 |
|
115 | 115 | return $factory->for_module( 'ppcp-compat' ); |
116 | 116 | }, |
117 | 117 |
|
118 | | - 'compat.assets' => function ( ContainerInterface $container ): CompatAssets { |
| 118 | + 'compat.assets' => function ( ContainerInterface $container ): CompatAssets { |
119 | 119 | return new CompatAssets( |
120 | 120 | $container->get( 'compat.asset_getter' ), |
121 | 121 | $container->get( 'ppcp.asset-version' ), |
|
131 | 131 | * |
132 | 132 | * @returns SettingsMap[] |
133 | 133 | */ |
134 | | - 'compat.setting.new-to-old-map' => static function ( ContainerInterface $container ): array { |
| 134 | + 'compat.setting.new-to-old-map' => static function ( ContainerInterface $container ): array { |
135 | 135 | $are_new_settings_enabled = $container->get( 'wcgateway.settings.admin-settings-enabled' ); |
136 | 136 | if ( ! $are_new_settings_enabled ) { |
137 | 137 | return array(); |
|
195 | 195 | ), |
196 | 196 | ); |
197 | 197 | }, |
198 | | - 'compat.settings.settings_map_helper' => static function ( ContainerInterface $container ): SettingsMapHelper { |
| 198 | + 'compat.settings.settings_map_helper' => static function ( ContainerInterface $container ): SettingsMapHelper { |
199 | 199 | return new SettingsMapHelper( |
200 | 200 | $container->get( 'compat.setting.new-to-old-map' ), |
201 | 201 | $container->get( 'compat.settings.styling_map_helper' ), |
|
206 | 206 | $container->get( 'wcgateway.settings.admin-settings-enabled' ) |
207 | 207 | ); |
208 | 208 | }, |
209 | | - 'compat.settings.styling_map_helper' => static function ( ContainerInterface $container ): StylingSettingsMapHelper { |
| 209 | + 'compat.settings.styling_map_helper' => static function ( ContainerInterface $container ): StylingSettingsMapHelper { |
210 | 210 | $context_provider = static function () use ( $container ): string { |
211 | 211 | $context = $container->get( 'button.helper.context' ); |
212 | 212 |
|
213 | 213 | return $context->context(); |
214 | 214 | }; |
215 | 215 | return new StylingSettingsMapHelper( $context_provider ); |
216 | 216 | }, |
217 | | - 'compat.settings.settings_tab_map_helper' => static function (): SettingsTabMapHelper { |
| 217 | + 'compat.settings.settings_tab_map_helper' => static function (): SettingsTabMapHelper { |
218 | 218 | return new SettingsTabMapHelper(); |
219 | 219 | }, |
220 | | - 'compat.settings.subscription_map_helper' => static function ( ContainerInterface $container ): SubscriptionSettingsMapHelper { |
| 220 | + 'compat.settings.subscription_map_helper' => static function ( ContainerInterface $container ): SubscriptionSettingsMapHelper { |
221 | 221 | return new SubscriptionSettingsMapHelper( $container->get( 'wc-subscriptions.helper' ) ); |
222 | 222 | }, |
223 | | - 'compat.settings.general_map_helper' => static function (): GeneralSettingsMapHelper { |
| 223 | + 'compat.settings.general_map_helper' => static function (): GeneralSettingsMapHelper { |
224 | 224 | return new GeneralSettingsMapHelper(); |
225 | 225 | }, |
226 | | - 'compat.settings.payment_methods_map_helper' => static function (): PaymentMethodSettingsMapHelper { |
| 226 | + 'compat.settings.payment_methods_map_helper' => static function (): PaymentMethodSettingsMapHelper { |
227 | 227 | return new PaymentMethodSettingsMapHelper(); |
228 | 228 | }, |
229 | | - 'compat.blueprint.is_available' => function (): bool { |
| 229 | + 'compat.blueprint.is_available' => function (): bool { |
230 | 230 | return interface_exists( 'Automattic\WooCommerce\Blueprint\Exporters\StepExporter' ); |
231 | 231 | }, |
232 | | - 'compat.blueprint.paypal_settings_exporter' => static function ( ContainerInterface $container ): PayPalSettingsExporter { |
| 232 | + 'compat.blueprint.paypal_settings_exporter' => static function ( ContainerInterface $container ): PayPalSettingsExporter { |
233 | 233 | return new PayPalSettingsExporter(); |
234 | 234 | }, |
235 | | - 'compat.blueprint.paypal_settings_importer' => static function ( ContainerInterface $container ): PayPalSettingsImporter { |
| 235 | + 'compat.blueprint.paypal_settings_importer' => static function ( ContainerInterface $container ): PayPalSettingsImporter { |
236 | 236 | return new PayPalSettingsImporter(); |
237 | 237 | }, |
238 | | - 'compat.blueprint.bootstrap' => static function ( ContainerInterface $container ): PayPalBlueprintBootstrap { |
| 238 | + 'compat.blueprint.bootstrap' => static function ( ContainerInterface $container ): PayPalBlueprintBootstrap { |
239 | 239 | return new PayPalBlueprintBootstrap( |
240 | 240 | $container->get( 'compat.blueprint.paypal_settings_exporter' ), |
241 | 241 | $container->get( 'compat.blueprint.paypal_settings_importer' ) |
|
0 commit comments