mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-30 05:00:51 +08:00
Just return __FILE__
when the realpath
fails.
This commit is contained in:
parent
0caa74c021
commit
e713abfd75
4 changed files with 6 additions and 31 deletions
|
@ -101,13 +101,8 @@ class PayLaterBlockModule implements ServiceModule, ExtendingModule, ExecutableM
|
|||
)
|
||||
);
|
||||
|
||||
/**
|
||||
* Cannot return false for this path.
|
||||
*
|
||||
* @psalm-suppress PossiblyFalseArgument
|
||||
*/
|
||||
register_block_type(
|
||||
dirname( realpath( __FILE__ ), 2 ),
|
||||
dirname( realpath( __FILE__ ) ?: __FILE__, 2 ),
|
||||
array(
|
||||
'render_callback' => function ( array $attributes ) use ( $c ) {
|
||||
$renderer = $c->get( 'paylater-block.renderer' );
|
||||
|
|
|
@ -192,13 +192,8 @@ class PayLaterWCBlocksModule implements ServiceModule, ExtendingModule, Executab
|
|||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cannot return false for this path.
|
||||
*
|
||||
* @psalm-suppress PossiblyFalseArgument
|
||||
*/
|
||||
register_block_type(
|
||||
dirname( realpath( __FILE__ ), 2 ) . '/resources/js/CartPayLaterMessagesBlock',
|
||||
dirname( realpath( __FILE__ ) ?: __FILE__, 2 ) . '/resources/js/CartPayLaterMessagesBlock',
|
||||
array(
|
||||
'render_callback' => function ( array $attributes ) use ( $c ) {
|
||||
return PayLaterWCBlocksUtils::render_paylater_block(
|
||||
|
@ -211,13 +206,8 @@ class PayLaterWCBlocksModule implements ServiceModule, ExtendingModule, Executab
|
|||
)
|
||||
);
|
||||
|
||||
/**
|
||||
* Cannot return false for this path.
|
||||
*
|
||||
* @psalm-suppress PossiblyFalseArgument
|
||||
*/
|
||||
register_block_type(
|
||||
dirname( realpath( __FILE__ ), 2 ) . '/resources/js/CheckoutPayLaterMessagesBlock',
|
||||
dirname( $path, 2 ) . '/resources/js/CheckoutPayLaterMessagesBlock',
|
||||
array(
|
||||
'render_callback' => function ( array $attributes ) use ( $c ) {
|
||||
return PayLaterWCBlocksUtils::render_paylater_block(
|
||||
|
|
|
@ -109,7 +109,7 @@ class ScriptDataHandler {
|
|||
*
|
||||
* @psalm-suppress UnresolvableInclude
|
||||
*/
|
||||
$script_asset_file = require dirname( realpath( __FILE__ ) ?: '', 3 ) . '/assets/index.asset.php';
|
||||
$script_asset_file = require dirname( realpath( __FILE__ ) ?: __FILE__, 3 ) . '/assets/index.asset.php';
|
||||
|
||||
$module_url = $this->settings_url;
|
||||
|
||||
|
@ -127,12 +127,7 @@ class ScriptDataHandler {
|
|||
'woocommerce-paypal-payments',
|
||||
);
|
||||
|
||||
/**
|
||||
* Require resolves.
|
||||
*
|
||||
* @psalm-suppress UnresolvableInclude
|
||||
*/
|
||||
$style_asset_file = require dirname( realpath( __FILE__ ) ?: '', 3 ) . '/assets/style.asset.php';
|
||||
$style_asset_file = require dirname( realpath( __FILE__ ) ?: __FILE__, 3 ) . '/assets/style.asset.php';
|
||||
|
||||
wp_register_style(
|
||||
'ppcp-admin-settings',
|
||||
|
|
|
@ -104,12 +104,7 @@ class SettingsModule implements ServiceModule, ExecutableModule {
|
|||
static function () use ( $container ) {
|
||||
$module_url = $container->get( 'settings.url' );
|
||||
|
||||
/**
|
||||
* Require resolves.
|
||||
*
|
||||
* @psalm-suppress UnresolvableInclude
|
||||
*/
|
||||
$script_asset_file = require dirname( realpath( __FILE__ ) ?: '', 2 ) . '/assets/switchSettingsUi.asset.php';
|
||||
$script_asset_file = require dirname( realpath( __FILE__ ) ?: __FILE__, 2 ) . '/assets/switchSettingsUi.asset.php';
|
||||
|
||||
wp_register_script(
|
||||
'ppcp-switch-settings-ui',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue