mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-07 19:54:15 +08:00
pspcs errors auto fix
This commit is contained in:
parent
64e9dc89c4
commit
4a2d522ccb
3 changed files with 12 additions and 11 deletions
|
@ -1876,17 +1876,18 @@ return array(
|
|||
},
|
||||
'wcgateway.url' => static function ( $container ): string {
|
||||
return plugins_url(
|
||||
$container->get('wcgateway.relative-path'),
|
||||
$container->get( 'wcgateway.relative-path' ),
|
||||
dirname( __FILE__, 3 ) . '/woocommerce-paypal-payments.php'
|
||||
);
|
||||
},
|
||||
'wcgateway.relative-path' => static function($container): string {
|
||||
'wcgateway.relative-path' => static function( $container ): string {
|
||||
return 'modules/ppcp-wc-gateway/';
|
||||
},
|
||||
'wcgateway.absolute-path' => static function($container): string {
|
||||
'wcgateway.absolute-path' => static function( $container ): string {
|
||||
return plugin_dir_path(
|
||||
dirname( __FILE__, 3 ) . '/woocommerce-paypal-payments.php') .
|
||||
$container->get('wcgateway.relative-path');
|
||||
dirname( __FILE__, 3 ) . '/woocommerce-paypal-payments.php'
|
||||
) .
|
||||
$container->get( 'wcgateway.relative-path' );
|
||||
},
|
||||
'wcgateway.endpoint.return-url' => static function ( $container ) : ReturnUrlEndpoint {
|
||||
$gateway = $container->get( 'wcgateway.paypal-gateway' );
|
||||
|
|
|
@ -34,7 +34,7 @@ class SettingsPageAssets {
|
|||
* @param string $module_path The filesystem path to this module.
|
||||
*/
|
||||
public function __construct( string $module_url, string $module_path ) {
|
||||
$this->module_url = $module_url;
|
||||
$this->module_url = $module_url;
|
||||
$this->module_path = $module_path;
|
||||
}
|
||||
|
||||
|
@ -51,16 +51,16 @@ class SettingsPageAssets {
|
|||
* Register assets for admin pages.
|
||||
*/
|
||||
private function register_admin_assets() {
|
||||
$gateway_settings_script_path = trailingslashit($this->module_path) . 'assets/js/gateway-settings.js';
|
||||
$gateway_settings_script_path = trailingslashit( $this->module_path ) . 'assets/js/gateway-settings.js';
|
||||
|
||||
add_action(
|
||||
'admin_enqueue_scripts',
|
||||
function() use ($gateway_settings_script_path) {
|
||||
function() use ( $gateway_settings_script_path ) {
|
||||
wp_enqueue_script(
|
||||
'ppcp-gateway-settings',
|
||||
trailingslashit( $this->module_url ) . 'assets/js/gateway-settings.js',
|
||||
array(),
|
||||
file_exists($gateway_settings_script_path) ? (string) filemtime($gateway_settings_script_path) : null,
|
||||
file_exists( $gateway_settings_script_path ) ? (string) filemtime( $gateway_settings_script_path ) : null,
|
||||
true
|
||||
);
|
||||
}
|
||||
|
|
|
@ -75,8 +75,8 @@ class WcGatewayModule implements ModuleInterface {
|
|||
|
||||
if ( $container->has( 'wcgateway.url' ) ) {
|
||||
$assets = new SettingsPageAssets(
|
||||
$container->get( 'wcgateway.url'),
|
||||
$container->get('wcgateway.absolute-path')
|
||||
$container->get( 'wcgateway.url' ),
|
||||
$container->get( 'wcgateway.absolute-path' )
|
||||
);
|
||||
$assets->register_assets();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue