Skip to content

Commit

Permalink
Merge branch 'trunk' into PCP-3621-fix-wc920-disconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexP11223 committed Sep 5, 2024
2 parents 38adb9b + db05ae9 commit 65076fa
Show file tree
Hide file tree
Showing 128 changed files with 3,517 additions and 935 deletions.
4 changes: 2 additions & 2 deletions .ddev/config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: woocommerce-paypal-payments
type: php
docroot: .ddev/wordpress
php_version: "7.2"
php_version: "7.4"
webserver_type: apache-fpm
router_http_port: "80"
router_https_port: "443"
Expand All @@ -18,7 +18,7 @@ hooks:
pre-start:
- exec-host: "mkdir -p .ddev/wordpress/wp-content/plugins/${DDEV_PROJECT}"
web_environment:
- WP_VERSION=6.2.2
- WP_VERSION=6.3.3
- WP_LOCALE=en_US
- WP_TITLE=WooCommerce PayPal Payments
- WP_MULTISITE=true
Expand Down
2 changes: 1 addition & 1 deletion .distignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ tests
.phpunit.result.cache
babel.config.json
node_modules
resources
modules/*/resources
*.lock
webpack.config.js
wp-cli.yml
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['7.3', '7.4', '8.2']
wc-versions: ['5.9.5', '7.7.2']
php-versions: ['7.4', '8.2']
wc-versions: ['6.9.4', '7.7.2']

name: PHP ${{ matrix.php-versions }} WC ${{ matrix.wc-versions }}
steps:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/package-new.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ jobs:

create_archive:
needs: check_version
uses: inpsyde/reusable-workflows/.github/workflows/build-plugin-archive.yml@feature/prefixed-archives
uses: inpsyde/reusable-workflows/.github/workflows/build-plugin-archive.yml@main
with:
PHP_VERSION: 7.2
PHP_VERSION: 7.4
PLUGIN_MAIN_FILE: ./woocommerce-paypal-payments.php
PLUGIN_VERSION: ${{ needs.check_version.outputs.version }}
PLUGIN_FOLDER_NAME: woocommerce-paypal-payments
ARCHIVE_NAME: woocommerce-paypal-payments-${{ needs.check_version.outputs.version }}
COMPILE_ASSETS_ARGS: '-vv --env=root'
2 changes: 1 addition & 1 deletion .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.2
php-version: 7.4

- name: Fix plugin version input # Add the version number if only suffix entered
run: echo "PACKAGE_VERSION=$(sed -nE '/Version:/s/.* ([0-9.]+).*/\1/p' woocommerce-paypal-payments.php)-$PACKAGE_VERSION" >> $GITHUB_ENV
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
php-versions: ['7.4', '8.0', '8.1', '8.2', '8.3']

name: PHP ${{ matrix.php-versions }}
steps:
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ PayPal's latest complete payments processing solution. Accept PayPal, Pay Later,

## Dependencies

* PHP >= 7.2
* WordPress >=5.3
* WooCommerce >=4.5
* PHP >= 7.4
* WordPress >= 6.3
* WooCommerce >= 6.9

## Development

Expand Down
46 changes: 9 additions & 37 deletions bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,8 @@
* @package WooCommerce\PayPalCommerce
*/

use WooCommerce\PayPalCommerce\Vendor\Dhii\Container\CachingContainer;
use WooCommerce\PayPalCommerce\Vendor\Dhii\Container\CompositeCachingServiceProvider;
use WooCommerce\PayPalCommerce\Vendor\Dhii\Container\CompositeContainer;
use WooCommerce\PayPalCommerce\Vendor\Dhii\Container\DelegatingContainer;
use WooCommerce\PayPalCommerce\Vendor\Dhii\Container\ProxyContainer;
use WooCommerce\PayPalCommerce\Vendor\Dhii\Modular\Module\ModuleInterface;
use WooCommerce\PayPalCommerce\Vendor\Interop\Container\ServiceProviderInterface;
use WooCommerce\PayPalCommerce\Vendor\Inpsyde\Modularity\Package;
use WooCommerce\PayPalCommerce\Vendor\Inpsyde\Modularity\Properties\PluginProperties;
use WooCommerce\PayPalCommerce\Vendor\Psr\Container\ContainerInterface;

return function (
Expand All @@ -34,38 +29,15 @@
*/
$modules = apply_filters( 'woocommerce_paypal_payments_modules', $modules );

$providers = array_map(
function ( ModuleInterface $module ): ServiceProviderInterface {
return $module->setup();
},
$modules
);

$provider = new CompositeCachingServiceProvider( $providers );
$proxy_container = new ProxyContainer();
// TODO: caching does not work currently,
// may want to consider fixing it later (pass proxy as parent to DelegatingContainer)
// for now not fixed since we were using this behavior for long time and fixing it now may break things.
$container = new DelegatingContainer( $provider );
/**
* Skip iterable vs array check.
*
* @psalm-suppress PossiblyInvalidArgument
*/
$app_container = new CachingContainer(
new CompositeContainer(
array_merge(
$additional_containers,
array( $container )
)
)
);
$proxy_container->setInnerContainer( $app_container );
// Initialize plugin.
$properties = PluginProperties::new( __FILE__ );
$bootstrap = Package::new( $properties );

foreach ( $modules as $module ) {
/* @var $module ModuleInterface module */
$module->run( $app_container );
$bootstrap->addModule( $module );
}

return $app_container;
$bootstrap->boot();

return $bootstrap->container();
};
9 changes: 7 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "PayPal Commerce Platform for WooCommerce",
"license": "GPL-2.0",
"require": {
"php": "^7.2 | ^8.0",
"php": "^7.4 | ^8.0",
"ext-json": "*",
"psr/log": "^1.1",
"ralouphie/getallheaders": "^3.0",
Expand All @@ -19,6 +19,7 @@
"dhii/module-interface": "^0.2 || ^0.3",
"container-interop/service-provider": "^0.4.0",
"dhii/containers": "^0.1.0-alpha1",
"inpsyde/modularity": "^1.7",
"woocommerce/woocommerce-sniffs": "^0.1.0",
"phpunit/phpunit": "^7.0 | ^8.0 | ^9.0",
"brain/monkey": "^2.4",
Expand Down Expand Up @@ -87,12 +88,16 @@
"packages": [
"psr/container",
"dhii/containers",
"dhii/module-interface"
"dhii/module-interface",
"inpsyde/modularity"
],
"delete_vendor_directories": true
}
},
"config": {
"platform": {
"php": "7.4"
},
"allow-plugins": {
"inpsyde/composer-assets-compiler": true,
"dealerdirect/phpcodesniffer-composer-installer": true,
Expand Down
Loading

0 comments on commit 65076fa

Please sign in to comment.