mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-07 19:54:15 +08:00
code style auto fixes
This commit is contained in:
parent
99d4911581
commit
22ffab2303
3 changed files with 37 additions and 37 deletions
|
@ -8,8 +8,8 @@ declare(strict_types=1);
|
|||
|
||||
namespace WooCommerce\PayPalCommerce\WcGateway\Assets;
|
||||
|
||||
class SettingsPageAssets
|
||||
{
|
||||
class SettingsPageAssets {
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
|
@ -17,19 +17,18 @@ class SettingsPageAssets
|
|||
|
||||
/**
|
||||
* Assets constructor.
|
||||
*
|
||||
* @param string $module_url The url of this module.
|
||||
*/
|
||||
public function __construct(string $module_url)
|
||||
{
|
||||
public function __construct( string $module_url ) {
|
||||
$this->module_url = $module_url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register assets provided by this module.
|
||||
*/
|
||||
public function register_assets(): void
|
||||
{
|
||||
if(is_admin() && ! is_ajax()){
|
||||
public function register_assets(): void {
|
||||
if ( is_admin() && ! is_ajax() ) {
|
||||
$this->register_admin_assets();
|
||||
}
|
||||
}
|
||||
|
@ -37,16 +36,18 @@ class SettingsPageAssets
|
|||
/**
|
||||
* Register assets for admin pages.
|
||||
*/
|
||||
private function register_admin_assets(): void
|
||||
{
|
||||
add_action('admin_enqueue_scripts', function(){
|
||||
private function register_admin_assets(): void {
|
||||
add_action(
|
||||
'admin_enqueue_scripts',
|
||||
function() {
|
||||
wp_enqueue_script(
|
||||
'ppcp-gateway-settings',
|
||||
trailingslashit($this->module_url) . 'assets/js/gateway-settings.js',
|
||||
[],
|
||||
trailingslashit( $this->module_url ) . 'assets/js/gateway-settings.js',
|
||||
array(),
|
||||
null,
|
||||
true
|
||||
);
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
|
@ -73,12 +73,11 @@ class WcGatewayModule implements ModuleInterface {
|
|||
}
|
||||
);
|
||||
|
||||
if($container->has('wcgateway.url')) {
|
||||
$assets = new SettingsPageAssets($container->get('wcgateway.url'));
|
||||
if ( $container->has( 'wcgateway.url' ) ) {
|
||||
$assets = new SettingsPageAssets( $container->get( 'wcgateway.url' ) );
|
||||
$assets->register_assets();
|
||||
}
|
||||
|
||||
|
||||
add_filter(
|
||||
Repository::NOTICES_FILTER,
|
||||
static function ( $notices ) use ( $container ): array {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue