diff --git a/bootstrap.php b/bootstrap.php
index 1972d92d3..673f34473 100644
--- a/bootstrap.php
+++ b/bootstrap.php
@@ -5,6 +5,8 @@
* @package WooCommerce\PayPalCommerce
*/
+namespace WooCommerce\PayPalCommerce;
+
use WooCommerce\PayPalCommerce\Vendor\Inpsyde\Modularity\Package;
use WooCommerce\PayPalCommerce\Vendor\Inpsyde\Modularity\Properties\PluginProperties;
use WooCommerce\PayPalCommerce\Vendor\Psr\Container\ContainerInterface;
diff --git a/modules.php b/modules.php
index 792aa636e..21a4e645e 100644
--- a/modules.php
+++ b/modules.php
@@ -5,10 +5,11 @@
* @package WooCommerce\PayPalCommerce
*/
+namespace WooCommerce\PayPalCommerce;
+
use WooCommerce\PayPalCommerce\PayLaterBlock\PayLaterBlockModule;
use WooCommerce\PayPalCommerce\PayLaterWCBlocks\PayLaterWCBlocksModule;
use WooCommerce\PayPalCommerce\PayLaterConfigurator\PayLaterConfiguratorModule;
-use WooCommerce\PayPalCommerce\PluginModule;
return function ( string $root_dir ): iterable {
$modules_dir = "$root_dir/modules";
diff --git a/phpcs.xml.dist b/phpcs.xml.dist
index d8661df81..6c82069e2 100644
--- a/phpcs.xml.dist
+++ b/phpcs.xml.dist
@@ -48,6 +48,7 @@
woocommerce-paypal-payments.php
modules.php
bootstrap.php
+ scoper.inc.php
*/node_modules/*
*/vendor/*
diff --git a/scoper.inc.php b/scoper.inc.php
new file mode 100644
index 000000000..dd73d2b36
--- /dev/null
+++ b/scoper.inc.php
@@ -0,0 +1,51 @@
+files()
+ ->ignoreVCS( true )
+ ->ignoreDotFiles( false ) // We need to keep .distignore around.
+ ->exclude(
+ array(
+ '.github',
+ '.ddev',
+ '.idea',
+ '.psalm',
+ 'tests',
+ )
+ )
+ ->in( '.' ),
+);
+
+return array(
+ 'prefix' => 'WooCommerce\\PayPalCommerce\\Vendor',
+ 'finders' => $finders,
+ 'patchers' => array(),
+ 'exclude-files' => array(), // list.
+ 'exclude-namespaces' => array(
+ '/^(?!Psr).*/', // Exclude all namespaces except those starting with "Psr".
+ ), // list.
+ 'exclude-constants' => array(), // list.
+ 'exclude-classes' => array(), // list.
+ 'exclude-functions' => array(), // list.
+
+ 'expose-global-constants' => false, // bool.
+ 'expose-global-classes' => false, // bool.
+ 'expose-global-functions' => false, // bool.
+
+ 'expose-namespaces' => array(), // list.
+ 'expose-constants' => array(), // list.
+ 'expose-classes' => array(), // list.
+ 'expose-functions' => array(), // list.
+);
diff --git a/uninstall.php b/uninstall.php
index 26fa6cb67..7ae2763b4 100644
--- a/uninstall.php
+++ b/uninstall.php
@@ -7,6 +7,8 @@
declare(strict_types=1);
+namespace WooCommerce\PayPalCommerce;
+
use WooCommerce\PayPalCommerce\Uninstall\ClearDatabaseInterface;
use WooCommerce\PayPalCommerce\Vendor\Psr\Container\ContainerInterface;
use WooCommerce\PayPalCommerce\WcGateway\Settings\Settings;