Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration with PHP-Scoper (968) #2993

Open
wants to merge 32 commits into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
902683b
Add the scoper branch to workflow
Narek13 Jan 10, 2025
4848d2e
include scoper in CS checks config
Narek13 Jan 10, 2025
395fd75
Create initial rector config file
Narek13 Jan 10, 2025
4f7079e
Exclude everything except from psr/log
Narek13 Jan 15, 2025
89f8762
use the main branch for the workflow
Narek13 Jan 15, 2025
2d897a2
use the main branch for the workflow
Narek13 Jan 15, 2025
e727d84
Fix the paths
Narek13 Jan 15, 2025
908eead
Fix the paths
Narek13 Jan 15, 2025
37384ce
Exclude files from root directory
Narek13 Jan 15, 2025
046a88e
Exclude dirs from root directory
Narek13 Jan 15, 2025
fc92cae
Exclude dirs from root directory
Narek13 Jan 15, 2025
b6fc9e9
Exclude dirs from root directory
Narek13 Jan 15, 2025
205a321
Try another wy to exclude all
Narek13 Jan 15, 2025
b681601
Fix the cs
Narek13 Jan 15, 2025
4d561eb
include only psr/log
Narek13 Jan 15, 2025
0a9d5a5
include only psr/log
Narek13 Jan 15, 2025
48126ba
include only psr/log
Narek13 Jan 15, 2025
50071fb
include only psr/log
Narek13 Jan 15, 2025
3e90baa
include only psr/log
Narek13 Jan 15, 2025
14e5b67
include only psr/log
Narek13 Jan 15, 2025
802def3
include only psr/log
Narek13 Jan 15, 2025
1ccbc40
Use regexp
Narek13 Jan 15, 2025
8c91850
Use regexp
Narek13 Jan 15, 2025
c9d6a15
Use regexp
Narek13 Jan 15, 2025
cb454a3
Use regexp
Narek13 Jan 15, 2025
6c5254d
try to exclude root files
Narek13 Jan 15, 2025
3b3e73d
try to exclude root files
Narek13 Jan 15, 2025
6e9da9e
try to exclude root files
Narek13 Jan 15, 2025
09e17a8
Add namespaces to root files
Narek13 Jan 15, 2025
6f15371
Add namespaces to root files
Narek13 Jan 15, 2025
46b00e7
add comment
Narek13 Jan 16, 2025
7764995
Remove leftover
Narek13 Jan 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
1 change: 1 addition & 0 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
<file>woocommerce-paypal-payments.php</file>
<file>modules.php</file>
<file>bootstrap.php</file>
<file>scoper.inc.php</file>

<exclude-pattern>*/node_modules/*</exclude-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern>
Expand Down
51 changes: 51 additions & 0 deletions scoper.inc.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php
/**
* The PHP-Scoper configuration.
*
* @package WooCommerce\PayPalCommerce
*/

declare(strict_types=1);

namespace WooCommerce\PayPalCommerce;

use Isolated\Symfony\Component\Finder\Finder;

$finders = array(
Finder::create()
->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<string>.
'exclude-namespaces' => array(
'/^(?!Psr).*/', // Exclude all namespaces except those starting with "Psr".
), // list<string|regex>.
'exclude-constants' => array(), // list<string|regex>.
'exclude-classes' => array(), // list<string|regex>.
'exclude-functions' => array(), // list<string|regex>.

'expose-global-constants' => false, // bool.
'expose-global-classes' => false, // bool.
'expose-global-functions' => false, // bool.

'expose-namespaces' => array(), // list<string|regex>.
'expose-constants' => array(), // list<string|regex>.
'expose-classes' => array(), // list<string|regex>.
'expose-functions' => array(), // list<string|regex>.
);
2 changes: 2 additions & 0 deletions uninstall.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading