diff --git a/bootstrap.php b/bootstrap.php index 40489a5..6ca3979 100644 --- a/bootstrap.php +++ b/bootstrap.php @@ -4,46 +4,28 @@ namespace Syde\PayPal\PointOfSale; -use Dhii\Container\CachingContainer; -use Dhii\Container\CompositeCachingServiceProvider; -use Dhii\Container\DelegatingContainer; -use Dhii\Container\ProxyContainer; -use Dhii\Modular\Module\ModuleInterface; -use Dhii\Validation\ValidatorInterface; -use Psr\Container\ContainerInterface; - -return static function (string $appDir, bool $validate = false): ContainerInterface { - $modules = []; - $classNames = require $appDir . '/modules.php'; - array_walk( - $classNames, - static function (string $className) use (&$modules): void { - $modules[] = new $className(); - } - ); - - $providers = []; - foreach ($modules as $module) { - assert($module instanceof ModuleInterface); - $providers[] = $module->setup(); +use Syde\PayPal\PointOfSale\Validation\ValidatorInterface; +use Inpsyde\Modularity\Package; +use Inpsyde\Modularity\Properties\PluginProperties; + +return static function (string $pluginFile, bool $validate = false): Package { + $properties = PluginProperties::new($pluginFile); + $package = Package::new($properties); + + $classNames = require dirname($pluginFile) . '/modules.php'; + foreach ($classNames as $className) { + $package->addModule(new $className()); } - $proxy = new ProxyContainer(); - $provider = new CompositeCachingServiceProvider($providers); - $container = new CachingContainer(new DelegatingContainer($provider, $proxy)); - $proxy->setInnerContainer($container); + $package->build(); if ($validate) { - $requirementsValidator = $container->get('paypal-pos.requirements.validator'); + $requirementsValidator = $package->container()->get('paypal-pos.requirements.validator'); assert($requirementsValidator instanceof ValidatorInterface); - $requirementsValidator->validate(null); } - foreach ($modules as $module) { - assert($module instanceof ModuleInterface); - $module->run($proxy); - } + $package->boot(); - return $proxy; + return $package; }; diff --git a/composer.json b/composer.json index 39a1d6e..7926476 100644 --- a/composer.json +++ b/composer.json @@ -39,10 +39,6 @@ "php": "^8.2", "ext-json": "*", "ext-mbstring": "*", - "container-interop/service-provider": "^0.4.0", - "dhii/containers": "^0.1", - "dhii/module-interface": "^0.2 || ^0.3", - "dhii/validator": "^0.1", "inpsyde/assets": "^2.1", "inpsyde/inpsyde-debug": "*", "inpsyde/inpsyde-http-client": "*", @@ -64,8 +60,10 @@ "inpsyde/paypal-pos-settings": "*", "inpsyde/paypal-pos-sync": "*", "inpsyde/paypal-pos-webhooks": "*", + "inpsyde/modularity": "^1.7", "oomphinc/composer-installers-extender": "^2.0", - "psr/container": "^1.0", + "psr/container": "^1.1 || ^2.0", + "psr/event-dispatcher": "^1.0", "sniccowp/php-scoper-wordpress-excludes": "^6.8" }, "require-dev": { diff --git a/composer.lock b/composer.lock index 477da78..7bf3ed4 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "87a5eed659416a160d97dc624a55b8b6", + "content-hash": "87b3b2a423e3bafdf0ff1b93e3e6e27d", "packages": [ { "name": "brain/nonces", - "version": "1.0.5", + "version": "1.0.6", "source": { "type": "git", "url": "https://github.com/Brain-WP/Nonces.git", - "reference": "81a1f2f8f8cd8288c5c920ce7b0c98e9c6e2ba88" + "reference": "0122a39077fb6fe7512891dfe9a4facc951e7e04" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Brain-WP/Nonces/zipball/81a1f2f8f8cd8288c5c920ce7b0c98e9c6e2ba88", - "reference": "81a1f2f8f8cd8288c5c920ce7b0c98e9c6e2ba88", + "url": "https://api.github.com/repos/Brain-WP/Nonces/zipball/0122a39077fb6fe7512891dfe9a4facc951e7e04", + "reference": "0122a39077fb6fe7512891dfe9a4facc951e7e04", "shasum": "", "mirrors": [ { @@ -27,7 +27,7 @@ ] }, "require": { - "php": ">=5.5.0" + "php": ">=7.1" }, "require-dev": { "brain/monkey": "~1.4", @@ -62,9 +62,9 @@ ], "support": { "issues": "https://github.com/Brain-WP/Nonces/issues", - "source": "https://github.com/Brain-WP/Nonces/tree/1.0.5" + "source": "https://github.com/Brain-WP/Nonces/tree/1.0.6" }, - "time": "2024-08-24T14:07:37+00:00" + "time": "2025-06-17T22:35:33+00:00" }, { "name": "clue/stream-filter", @@ -290,408 +290,6 @@ ], "time": "2024-06-24T20:46:46+00:00" }, - { - "name": "container-interop/service-provider", - "version": "v0.4.1", - "source": { - "type": "git", - "url": "https://github.com/container-interop/service-provider.git", - "reference": "e04441ca21ef03e10dce70b0af29269281eec6dc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/container-interop/service-provider/zipball/e04441ca21ef03e10dce70b0af29269281eec6dc", - "reference": "e04441ca21ef03e10dce70b0af29269281eec6dc", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.packagist.com/inpsyde/dists/%package%/%version%/r%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "psr/container": "^1.0 || ^2.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Interop\\Container\\": "src/" - } - }, - "notification-url": "https://repo.packagist.com/inpsyde/downloads/", - "license": [ - "MIT" - ], - "description": "Promoting container interoperability through standard service providers", - "homepage": "https://github.com/container-interop/service-provider", - "support": { - "issues": "https://github.com/container-interop/service-provider/issues", - "source": "https://github.com/container-interop/service-provider/tree/v0.4.1" - }, - "time": "2023-12-14T14:50:12+00:00" - }, - { - "name": "dhii/collections-interface", - "version": "v0.3.0", - "source": { - "type": "git", - "url": "https://github.com/Dhii/collections-interface.git", - "reference": "74464a969b340d16889eacd9eadc9817f7e7f47a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Dhii/collections-interface/zipball/74464a969b340d16889eacd9eadc9817f7e7f47a", - "reference": "74464a969b340d16889eacd9eadc9817f7e7f47a", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.packagist.com/inpsyde/dists/%package%/%version%/r%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "php": "^7.1 | ^8.0", - "psr/container": "^1.0" - }, - "require-dev": { - "phpunit/phpunit": "^7.0 | ^8.0 | ^9.0", - "slevomat/coding-standard": "^6.0", - "vimeo/psalm": "^4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-develop": "0.3.x-dev" - } - }, - "autoload": { - "psr-4": { - "Dhii\\Collection\\": "src" - } - }, - "notification-url": "https://repo.packagist.com/inpsyde/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Dhii Team", - "email": "development@dhii.co" - }, - { - "name": "Anton Ukhanev", - "email": "xedin.unknown@gmail.com" - } - ], - "description": "A highly ISP-compliant collection of interfaces that represent maps and lists.", - "support": { - "issues": "https://github.com/Dhii/collections-interface/issues", - "source": "https://github.com/Dhii/collections-interface/tree/v0.3.0" - }, - "time": "2021-10-06T10:56:09+00:00" - }, - { - "name": "dhii/containers", - "version": "v0.1.5", - "source": { - "type": "git", - "url": "https://github.com/Dhii/containers.git", - "reference": "1568cb2def9dee213c5846c4618f9d6b2cebbdef" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Dhii/containers/zipball/1568cb2def9dee213c5846c4618f9d6b2cebbdef", - "reference": "1568cb2def9dee213c5846c4618f9d6b2cebbdef", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.packagist.com/inpsyde/dists/%package%/%version%/r%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "container-interop/service-provider": "^0.4", - "dhii/collections-interface": "^0.3.0-alpha4", - "php": "^7.4 | ^8.0" - }, - "require-dev": { - "gmazzap/andrew": "^1.1", - "phpunit/phpunit": "^9.0", - "psr/container": "^1.0", - "psr/simple-cache": "^1.0", - "slevomat/coding-standard": "^6.0", - "vimeo/psalm": "^5.0", - "wildwolf/psr-memory-cache": "^1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-develop": "0.1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Dhii\\Container\\": "src/" - } - }, - "notification-url": "https://repo.packagist.com/inpsyde/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Dhii Team", - "email": "development@dhii.co" - } - ], - "description": "A selection of PSR-11 containers for utility, simplicity, and ease.", - "keywords": [ - "PSR-11", - "container" - ], - "support": { - "issues": "https://github.com/Dhii/containers/issues", - "source": "https://github.com/Dhii/containers/tree/v0.1.5" - }, - "time": "2024-04-27T01:55:40+00:00" - }, - { - "name": "dhii/event-dispatcher-interface", - "version": "v0.1.0-alpha1", - "source": { - "type": "git", - "url": "https://github.com/Dhii/event-dispatcher-interface.git", - "reference": "fbcd6f1ae1c6646670c8c9a2055002ce96ea137f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Dhii/event-dispatcher-interface/zipball/fbcd6f1ae1c6646670c8c9a2055002ce96ea137f", - "reference": "fbcd6f1ae1c6646670c8c9a2055002ce96ea137f", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.packagist.com/inpsyde/dists/%package%/%version%/r%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "php": ">=7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-develop": "0.1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Dhii\\Events\\": "src/" - } - }, - "notification-url": "https://repo.packagist.com/inpsyde/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - }, - { - "name": "Anton Ukhanev", - "email": "xedin.unknown@gmail.com", - "role": "Developer" - } - ], - "description": "Standard interfaces for event handling.", - "keywords": [ - "events", - "psr", - "psr-14" - ], - "time": "2020-04-10T16:32:51+00:00" - }, - { - "name": "dhii/module-interface", - "version": "v0.3.0-alpha2", - "source": { - "type": "git", - "url": "https://github.com/Dhii/module-interface.git", - "reference": "0e39f167d7ed8990c82f5d2e6084159d1a502a5b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Dhii/module-interface/zipball/0e39f167d7ed8990c82f5d2e6084159d1a502a5b", - "reference": "0e39f167d7ed8990c82f5d2e6084159d1a502a5b", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.packagist.com/inpsyde/dists/%package%/%version%/r%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "container-interop/service-provider": "^0.4", - "php": "^7.1 | ^8.0", - "psr/container": "^1.0" - }, - "require-dev": { - "phpunit/phpunit": "^7.0 | ^8.0 | ^9.0", - "slevomat/coding-standard": "^6.0", - "vimeo/psalm": "^3.11.7 | ^4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-develop": "0.3.x-dev" - } - }, - "autoload": { - "psr-4": { - "Dhii\\Modular\\Module\\": "src" - } - }, - "notification-url": "https://repo.packagist.com/inpsyde/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Dhii Team", - "email": "development@dhii.co" - } - ], - "description": "Interfaces for modules", - "support": { - "issues": "https://github.com/Dhii/module-interface/issues", - "source": "https://github.com/Dhii/module-interface/tree/v0.3.0-alpha2" - }, - "time": "2021-08-23T08:23:01+00:00" - }, - { - "name": "dhii/validation-interface", - "version": "v0.3.0-alpha3", - "source": { - "type": "git", - "url": "https://github.com/Dhii/validation-interface.git", - "reference": "0e73c7bf3d2421ceb79331c60a9bc1b1d5eb65a6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Dhii/validation-interface/zipball/0e73c7bf3d2421ceb79331c60a9bc1b1d5eb65a6", - "reference": "0e73c7bf3d2421ceb79331c60a9bc1b1d5eb65a6", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.packagist.com/inpsyde/dists/%package%/%version%/r%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "php": "^7.1 | ^8.0" - }, - "require-dev": { - "phpunit/phpunit": "^7.0 | ^8.0 | ^9.0", - "slevomat/coding-standard": "^6.0", - "symfony/polyfill-mbstring": "1.20", - "symfony/polyfill-php80": "^1.19", - "vimeo/psalm": "^3.11.7 | ^4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-develop": "0.3.x-dev" - } - }, - "autoload": { - "psr-4": { - "Dhii\\Validation\\": "src/" - } - }, - "notification-url": "https://repo.packagist.com/inpsyde/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Anton Ukhanev", - "email": "xedin.unknown@gmail.com" - } - ], - "description": "A base interface for validators", - "support": { - "issues": "https://github.com/Dhii/validation-interface/issues", - "source": "https://github.com/Dhii/validation-interface/tree/v0.3.0-alpha3" - }, - "time": "2021-01-14T16:19:20+00:00" - }, - { - "name": "dhii/validator", - "version": "v0.1.0-alpha1", - "source": { - "type": "git", - "url": "https://github.com/Dhii/validator.git", - "reference": "e10fba08398e33e123ada3d5fe0d147a72525cc2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Dhii/validator/zipball/e10fba08398e33e123ada3d5fe0d147a72525cc2", - "reference": "e10fba08398e33e123ada3d5fe0d147a72525cc2", - "shasum": "", - "mirrors": [ - { - "url": "https://repo.packagist.com/inpsyde/dists/%package%/%version%/r%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "dhii/validation-interface": "^0.3.0-alpha3", - "php": "^7.1 | ^8.0" - }, - "require-dev": { - "phpunit/phpunit": "^7.1 | ^8.0 | ^9.0", - "slevomat/coding-standard": "^6.0", - "vimeo/psalm": "^3.11.7 | ^4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-initial": "0.1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Dhii\\Validator\\": "src" - } - }, - "notification-url": "https://repo.packagist.com/inpsyde/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Anton Ukhanev", - "email": "xedin.unknown@gmail.com", - "role": "Developer" - } - ], - "description": "A thin, standards-compliant validator implementation.", - "support": { - "issues": "https://github.com/Dhii/validator/issues", - "source": "https://github.com/Dhii/validator/tree/v0.1.0-alpha1" - }, - "time": "2021-01-14T22:19:45+00:00" - }, { "name": "doctrine/inflector", "version": "1.4.4", @@ -796,16 +394,16 @@ }, { "name": "inpsyde/assets", - "version": "2.11.0", + "version": "2.13", "source": { "type": "git", "url": "https://github.com/inpsyde/assets.git", - "reference": "a8a8ba88ebc10e54e4044dc6d5b0a4b0272923af" + "reference": "3b30fb2ec910d834f19a4010bebfdb17423fb21a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/inpsyde/assets/zipball/a8a8ba88ebc10e54e4044dc6d5b0a4b0272923af", - "reference": "a8a8ba88ebc10e54e4044dc6d5b0a4b0272923af", + "url": "https://api.github.com/repos/inpsyde/assets/zipball/3b30fb2ec910d834f19a4010bebfdb17423fb21a", + "reference": "3b30fb2ec910d834f19a4010bebfdb17423fb21a", "shasum": "", "mirrors": [ { @@ -868,21 +466,21 @@ "description": "Package to manage assets in WordPress.", "support": { "issues": "https://github.com/inpsyde/assets/issues", - "source": "https://github.com/inpsyde/assets/tree/2.11.0" + "source": "https://github.com/inpsyde/assets/tree/2.13" }, - "time": "2025-10-30T14:02:36+00:00" + "time": "2026-02-20T17:51:50+00:00" }, { "name": "inpsyde/inpsyde-debug", - "version": "dev-dev/main", + "version": "dev-dev/IZET-510-migrate-pos-to-inpsyde-modularity", "dist": { "type": "path", "url": "./modules.local/inpsyde-debug", - "reference": "6c6c1dcd820e64f6b8c520222488ada1219d55ae" + "reference": "73db0e3208790609b1ede943a0bde8401f259a5f" }, "require": { - "dhii/module-interface": "^0.2 || ^0.3", "ext-json": "*", + "inpsyde/modularity": "^1.7", "php": "^7.4 | ^8.0", "psr/log": "^1.1" }, @@ -908,14 +506,14 @@ }, { "name": "inpsyde/inpsyde-http-client", - "version": "dev-dev/main", + "version": "dev-dev/IZET-510-migrate-pos-to-inpsyde-modularity", "dist": { "type": "path", "url": "./modules.local/inpsyde-http-client", - "reference": "25ed6ee4221aad7bc19151cf8221826b43c1877a" + "reference": "7ba42da9ec128fa1e47eaf46185b3a48dd4d260b" }, "require": { - "dhii/module-interface": "^0.2 || ^0.3", + "inpsyde/modularity": "^1.7", "inpsyde/psr-18-wp-http-client": "^0.1", "nyholm/psr7": "^1.2", "php-http/client-common": "^2.1", @@ -935,16 +533,15 @@ }, { "name": "inpsyde/inpsyde-queue", - "version": "dev-dev/main", + "version": "dev-dev/IZET-510-migrate-pos-to-inpsyde-modularity", "dist": { "type": "path", "url": "./modules.local/inpsyde-queue", - "reference": "e10798d476e938dfef648ecdff5e9ed6bbd47d45" + "reference": "c8ea8634e16d5402f0c11567918cae4360a0e52b" }, "require": { - "dhii/containers": "^0.1", - "dhii/module-interface": "^0.2 || ^0.3", "ext-json": "*", + "inpsyde/modularity": "^1.7", "psr/log": "^1.1" }, "require-dev": { @@ -969,16 +566,15 @@ }, { "name": "inpsyde/inpsyde-state-machine", - "version": "dev-dev/main", + "version": "dev-dev/IZET-510-migrate-pos-to-inpsyde-modularity", "dist": { "type": "path", "url": "./modules.local/inpsyde-state-machine", - "reference": "ac8ef0ed78812cb7b0d4f6d7d586ee576b396ca0" + "reference": "b98f04177e7548173f054971920f52549edf2e48" }, "require": { - "dhii/containers": "^0.1", - "dhii/event-dispatcher-interface": "0.1.0-alpha1", - "dhii/module-interface": "^0.2 || ^0.3" + "inpsyde/modularity": "^1.7", + "psr/event-dispatcher": "^1.0" }, "require-dev": { "brianium/paratest": "^4.0 || ^6.0", @@ -1002,15 +598,14 @@ }, { "name": "inpsyde/inpsyde-woocommerce-lifecycle-events", - "version": "dev-dev/main", + "version": "dev-dev/IZET-510-migrate-pos-to-inpsyde-modularity", "dist": { "type": "path", "url": "./modules.local/inpsyde-woocommerce-lifecycle-events", - "reference": "0cdd3bdec20383bbb1a1f88873e2098475c677be" + "reference": "b31984830117eb89fc656d776987b031e71c7f2c" }, "require": { - "dhii/containers": "^0.1", - "dhii/module-interface": "^0.2 || ^0.3" + "inpsyde/modularity": "^1.7" }, "require-dev": { "brianium/paratest": "^4.0 || ^6.0", @@ -1101,17 +696,84 @@ }, "time": "2023-01-20T15:44:29+00:00" }, + { + "name": "inpsyde/modularity", + "version": "1.12.0", + "source": { + "type": "git", + "url": "https://github.com/inpsyde/modularity.git", + "reference": "e1ca1c81b7b663355906b586525d21ac5d46bc65" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/inpsyde/modularity/zipball/e1ca1c81b7b663355906b586525d21ac5d46bc65", + "reference": "e1ca1c81b7b663355906b586525d21ac5d46bc65", + "shasum": "", + "mirrors": [ + { + "url": "https://repo.packagist.com/inpsyde/dists/%package%/%version%/r%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "ext-json": "*", + "php": ">=7.4", + "psr/container": "^1.1.0 || ^2" + }, + "require-dev": { + "brain/monkey": "^2.6.1", + "inpsyde/wp-stubs-versions": "6.7", + "mikey179/vfsstream": "^v1.6.11", + "phpstan/phpstan": "^2.1.1", + "phpstan/phpstan-deprecation-rules": "^2.0.1", + "phpstan/phpstan-mockery": "^2.0.0", + "phpstan/phpstan-phpunit": "^2.0.4", + "phpunit/phpunit": "^9.6.19", + "swissspidy/phpstan-no-private": "^v1.0.0", + "syde/phpcs": "^1.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Inpsyde\\Modularity\\": "src/" + } + }, + "notification-url": "https://repo.packagist.com/inpsyde/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "Syde GmbH", + "email": "hello@syde.com", + "homepage": "https://syde.com/", + "role": "Company" + } + ], + "description": "Modular PSR-11 implementation for WordPress plugins, themes or libraries.", + "support": { + "issues": "https://github.com/inpsyde/modularity/issues", + "source": "https://github.com/inpsyde/modularity/tree/1.12.0" + }, + "time": "2025-05-09T12:13:17+00:00" + }, { "name": "inpsyde/paypal-pos-assets", - "version": "dev-dev/main", + "version": "dev-dev/IZET-510-migrate-pos-to-inpsyde-modularity", "dist": { "type": "path", "url": "./modules.local/paypal-pos-assets", - "reference": "0127135a53bf83c79fcc0df0c000ad94b4db6a8c" + "reference": "13c18e8e18d3ef1ffbe87f41e64de4888b82001f" }, "require": { - "dhii/module-interface": "^0.2 || ^0.3", - "inpsyde/assets": "^2.1" + "inpsyde/assets": "^2.1", + "inpsyde/modularity": "^1.7" }, "type": "inpsyde-module", "autoload": { @@ -1125,15 +787,15 @@ }, { "name": "inpsyde/paypal-pos-auth", - "version": "dev-dev/main", + "version": "dev-dev/IZET-510-migrate-pos-to-inpsyde-modularity", "dist": { "type": "path", "url": "./modules.local/paypal-pos-auth", - "reference": "32539ddfa93a977f686e0fb3bcc37d688ffe2c31" + "reference": "33728826e28464a8508724513afd126d7b086a74" }, "require": { - "dhii/module-interface": "^0.2 || ^0.3", "ext-openssl": "*", + "inpsyde/modularity": "^1.7", "psr/http-client": "^1.0" }, "require-dev": { @@ -1152,15 +814,15 @@ }, { "name": "inpsyde/paypal-pos-logging", - "version": "dev-dev/main", + "version": "dev-dev/IZET-510-migrate-pos-to-inpsyde-modularity", "dist": { "type": "path", "url": "./modules.local/paypal-pos-logging", - "reference": "a5a26b642f03cfecdc91ff479f6e4a78abcd1e82" + "reference": "b19d1f4680e00526a7f260dfc87e29a8aad5876b" }, "require": { - "dhii/module-interface": "^0.2 || ^0.3", "ext-json": "*", + "inpsyde/modularity": "^1.7", "psr/log": "^1.1" }, "require-dev": { @@ -1188,14 +850,14 @@ }, { "name": "inpsyde/paypal-pos-notices", - "version": "dev-dev/main", + "version": "dev-dev/IZET-510-migrate-pos-to-inpsyde-modularity", "dist": { "type": "path", "url": "./modules.local/paypal-pos-notices", - "reference": "536ac74227cbce1ad2561fd83748e5ae949597cb" + "reference": "36c8dc5fde59de92b144cb072ede22637d777d84" }, "require": { - "dhii/module-interface": "^0.2 || ^0.3" + "inpsyde/modularity": "^1.7" }, "type": "inpsyde-module", "autoload": { @@ -1209,15 +871,15 @@ }, { "name": "inpsyde/paypal-pos-onboarding", - "version": "dev-dev/main", + "version": "dev-dev/IZET-510-migrate-pos-to-inpsyde-modularity", "dist": { "type": "path", "url": "./modules.local/paypal-pos-onboarding", - "reference": "6fbc77de162bb873fa68ac353118e7b5b7dd553e" + "reference": "aeb2def3e0f21d8a24297da944ef47e66dafbe72" }, "require": { - "dhii/module-interface": "^0.2 || ^0.3", "inpsyde/inpsyde-state-machine": "*", + "inpsyde/modularity": "^1.7", "inpsyde/paypal-pos-auth": "*", "inpsyde/paypal-pos-php-sdk": "*", "inpsyde/wc-product-contracts": "*" @@ -1244,15 +906,14 @@ }, { "name": "inpsyde/paypal-pos-php-sdk", - "version": "dev-dev/main", + "version": "dev-dev/IZET-510-migrate-pos-to-inpsyde-modularity", "dist": { "type": "path", "url": "./modules.local/paypal-pos-php-sdk", - "reference": "0add7017f943ba2fa4e2639b4887cc3e95e46818" + "reference": "0641ff71e15cf789822a33909ddf399605245bcf" }, "require": { - "dhii/containers": "^0.1", - "dhii/module-interface": "^0.2 || ^0.3", + "inpsyde/modularity": "^1.7", "inpsyde/wc-product-contracts": "*", "psr/log": "^1.1", "symfony/uid": "^5.1", @@ -1283,14 +944,14 @@ }, { "name": "inpsyde/paypal-pos-product-debug", - "version": "dev-dev/main", + "version": "dev-dev/IZET-510-migrate-pos-to-inpsyde-modularity", "dist": { "type": "path", "url": "./modules.local/paypal-pos-product-debug", - "reference": "02041da607a8ba0dd4c3c6314598315ddca9d05b" + "reference": "fdbd217f7357e7b84e609e5330ff38543a97a424" }, "require": { - "dhii/module-interface": "^0.2 || ^0.3" + "inpsyde/modularity": "^1.7" }, "type": "inpsyde-module", "autoload": { @@ -1304,14 +965,14 @@ }, { "name": "inpsyde/paypal-pos-product-settings", - "version": "dev-dev/main", + "version": "dev-dev/IZET-510-migrate-pos-to-inpsyde-modularity", "dist": { "type": "path", "url": "./modules.local/paypal-pos-product-settings", - "reference": "35cfcad968f625739316903af206bcdb62fb8dfb" + "reference": "f66a39835529733bfc973851b22639a72af4c88d" }, "require": { - "dhii/module-interface": "^0.2 || ^0.3", + "inpsyde/modularity": "^1.7", "inpsyde/wc-product-contracts": "*" }, "type": "inpsyde-module", @@ -1326,15 +987,15 @@ }, { "name": "inpsyde/paypal-pos-queue", - "version": "dev-dev/main", + "version": "dev-dev/IZET-510-migrate-pos-to-inpsyde-modularity", "dist": { "type": "path", "url": "./modules.local/paypal-pos-queue", - "reference": "135d0566af13cef91138dbb0d928c920869ad4ee" + "reference": "d7d3bbc954f81f1cfc7eb669fb3bbfb5f23fbb8d" }, "require": { - "dhii/module-interface": "^0.2 || ^0.3", - "ext-json": "*" + "ext-json": "*", + "inpsyde/modularity": "^1.7" }, "type": "inpsyde-module", "autoload": { @@ -1348,14 +1009,14 @@ }, { "name": "inpsyde/paypal-pos-settings", - "version": "dev-dev/main", + "version": "dev-dev/IZET-510-migrate-pos-to-inpsyde-modularity", "dist": { "type": "path", "url": "./modules.local/paypal-pos-settings", - "reference": "80c2303e1e262772d5000b228b260c2f0f5c1c64" + "reference": "c0cd45f64613f4c76b10ba0349cfc7abebc78671" }, "require": { - "dhii/module-interface": "^0.2 || ^0.3" + "inpsyde/modularity": "^1.7" }, "type": "inpsyde-module", "autoload": { @@ -1369,14 +1030,14 @@ }, { "name": "inpsyde/paypal-pos-sync", - "version": "dev-dev/main", + "version": "dev-dev/IZET-510-migrate-pos-to-inpsyde-modularity", "dist": { "type": "path", "url": "./modules.local/paypal-pos-sync", - "reference": "4f7acff8f318e9f5a010e8679eed54ef20ba75be" + "reference": "1988ccc1f7fad401c9478577b2ff24a0732b59ca" }, "require": { - "dhii/module-interface": "^0.2 || ^0.3", + "inpsyde/modularity": "^1.7", "inpsyde/wc-product-contracts": "*" }, "type": "inpsyde-module", @@ -1391,15 +1052,15 @@ }, { "name": "inpsyde/paypal-pos-webhooks", - "version": "dev-dev/main", + "version": "dev-dev/IZET-510-migrate-pos-to-inpsyde-modularity", "dist": { "type": "path", "url": "./modules.local/paypal-pos-webhooks", - "reference": "800ef55eb1cf0f4ed41bb27b3decb648fefeaf2f" + "reference": "6496b12f39f637e9dacc1707e099602c9a88b01d" }, "require": { - "dhii/module-interface": "^0.2 || ^0.3", "inpsyde/inpsyde-queue": "*", + "inpsyde/modularity": "^1.7", "inpsyde/paypal-pos-php-sdk": "*" }, "require-dev": { @@ -1425,16 +1086,16 @@ }, { "name": "inpsyde/psr-18-wp-http-client", - "version": "v0.1.0-alpha4", + "version": "0.1.0-alpha5", "source": { "type": "git", "url": "git@github.com:inpsyde/psr-18-wp-http-client.git", - "reference": "8dd172262c95fc3fb4716b14a54c9406254ba441" + "reference": "56c12fe3cfafbc7a8643cb9a8e6e0fbab5c3661b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/inpsyde/psr-18-wp-http-client/zipball/8dd172262c95fc3fb4716b14a54c9406254ba441", - "reference": "8dd172262c95fc3fb4716b14a54c9406254ba441", + "url": "https://api.github.com/repos/inpsyde/psr-18-wp-http-client/zipball/56c12fe3cfafbc7a8643cb9a8e6e0fbab5c3661b", + "reference": "56c12fe3cfafbc7a8643cb9a8e6e0fbab5c3661b", "shasum": "", "mirrors": [ { @@ -1444,7 +1105,7 @@ ] }, "require": { - "php": "^7.0 | ^8.0", + "php": "^7.4 | ^8.0", "psr/http-client": "^1.0", "psr/http-factory": "^1.0", "psr/http-message": "^1.0" @@ -1454,9 +1115,9 @@ }, "require-dev": { "brain/monkey": "2.*", - "inpsyde/php-coding-standards": "^1.0.0-beta1", - "johnpbloch/wordpress-core": "^5.0", - "phpunit/phpunit": "^6.0 | ^7.0 | ^8.0 | ^9.0", + "inpsyde/php-coding-standards": "@stable", + "johnpbloch/wordpress-core": "^6.0", + "phpunit/phpunit": "^8.5 | ^9.0", "squizlabs/php_codesniffer": "^3.4", "voku/httpful": "^2.4" }, @@ -1482,8 +1143,9 @@ ], "authors": [ { - "name": "Inpsyde GmbH", - "email": "hello@inpsyde.com", + "name": "Syde GmbH", + "homepage": "https://syde.com/", + "email": "hello@syde.com", "role": "Company" }, { @@ -1494,14 +1156,14 @@ ], "description": "A PSR-18 compatible wrapper for WordPress HTTP requests", "support": { - "source": "https://github.com/inpsyde/psr-18-wp-http-client/tree/v0.1.0-alpha4", + "source": "https://github.com/inpsyde/psr-18-wp-http-client/tree/0.1.0-alpha5", "issues": "https://github.com/inpsyde/psr-18-wp-http-client/issues" }, - "time": "2021-10-01T10:22:17+00:00" + "time": "2026-03-05T12:55:36+00:00" }, { "name": "inpsyde/wc-product-contracts", - "version": "dev-dev/main", + "version": "dev-dev/IZET-510-migrate-pos-to-inpsyde-modularity", "dist": { "type": "path", "url": "./packages.local/wc-product-contracts", @@ -1532,14 +1194,14 @@ }, { "name": "inpsyde/wc-status-report", - "version": "dev-dev/main", + "version": "dev-dev/IZET-510-migrate-pos-to-inpsyde-modularity", "dist": { "type": "path", "url": "./modules.local/inpsyde-wc-status-report", - "reference": "22bd64c5aef17fc0a560025e051bd2286232fd2b" + "reference": "efb4a7ddfed998d204b265b6c5cebe8cf1bcc433" }, "require": { - "dhii/module-interface": "^0.2 || ^0.3" + "inpsyde/modularity": "^1.7" }, "require-dev": { "brianium/paratest": "^4.0 || ^6.0", @@ -1804,16 +1466,16 @@ }, { "name": "php-http/client-common", - "version": "2.7.2", + "version": "2.7.3", "source": { "type": "git", "url": "https://github.com/php-http/client-common.git", - "reference": "0cfe9858ab9d3b213041b947c881d5b19ceeca46" + "reference": "dcc6de29c90dd74faab55f71b79d89409c4bf0c1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/client-common/zipball/0cfe9858ab9d3b213041b947c881d5b19ceeca46", - "reference": "0cfe9858ab9d3b213041b947c881d5b19ceeca46", + "url": "https://api.github.com/repos/php-http/client-common/zipball/dcc6de29c90dd74faab55f71b79d89409c4bf0c1", + "reference": "dcc6de29c90dd74faab55f71b79d89409c4bf0c1", "shasum": "", "mirrors": [ { @@ -1829,15 +1491,13 @@ "psr/http-client": "^1.0", "psr/http-factory": "^1.0", "psr/http-message": "^1.0 || ^2.0", - "symfony/options-resolver": "~4.0.15 || ~4.1.9 || ^4.2.1 || ^5.0 || ^6.0 || ^7.0", + "symfony/options-resolver": "~4.0.15 || ~4.1.9 || ^4.2.1 || ^5.0 || ^6.0 || ^7.0 || ^8.0", "symfony/polyfill-php80": "^1.17" }, "require-dev": { "doctrine/instantiator": "^1.1", "guzzlehttp/psr7": "^1.4", "nyholm/psr7": "^1.2", - "phpspec/phpspec": "^5.1 || ^6.3 || ^7.1", - "phpspec/prophecy": "^1.10.2", "phpunit/phpunit": "^7.5.20 || ^8.5.33 || ^9.6.7" }, "suggest": { @@ -1873,22 +1533,22 @@ ], "support": { "issues": "https://github.com/php-http/client-common/issues", - "source": "https://github.com/php-http/client-common/tree/2.7.2" + "source": "https://github.com/php-http/client-common/tree/2.7.3" }, - "time": "2024-09-24T06:21:48+00:00" + "time": "2025-11-29T19:12:34+00:00" }, { "name": "php-http/curl-client", - "version": "2.3.3", + "version": "2.4.0", "source": { "type": "git", "url": "https://github.com/php-http/curl-client.git", - "reference": "f3eb48d266341afec0229a7a37a03521d3646b81" + "reference": "f59d6992065f44be8b8fb484dd678a919c27dbf2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/curl-client/zipball/f3eb48d266341afec0229a7a37a03521d3646b81", - "reference": "f3eb48d266341afec0229a7a37a03521d3646b81", + "url": "https://api.github.com/repos/php-http/curl-client/zipball/f59d6992065f44be8b8fb484dd678a919c27dbf2", + "reference": "f59d6992065f44be8b8fb484dd678a919c27dbf2", "shasum": "", "mirrors": [ { @@ -1899,13 +1559,13 @@ }, "require": { "ext-curl": "*", - "php": "^7.4 || ^8.0", + "php": "^8.1", "php-http/discovery": "^1.6", "php-http/httplug": "^2.0", "php-http/message": "^1.2", "psr/http-client": "^1.0", "psr/http-factory-implementation": "^1.0", - "symfony/options-resolver": "^3.4 || ^4.0 || ^5.0 || ^6.0 || ^7.0" + "symfony/options-resolver": "^3.4 || ^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0" }, "provide": { "php-http/async-client-implementation": "1.0", @@ -1915,9 +1575,9 @@ "require-dev": { "guzzlehttp/psr7": "^2.0", "laminas/laminas-diactoros": "^2.0 || ^3.0", - "php-http/client-integration-tests": "^3.0", + "php-http/client-integration-tests": "^4.0", "php-http/message-factory": "^1.1", - "phpunit/phpunit": "^7.5 || ^9.4" + "phpunit/phpunit": "^9.6.17 || ^10.0 || ^11.0 || ^12.0" }, "type": "library", "autoload": { @@ -1944,9 +1604,9 @@ ], "support": { "issues": "https://github.com/php-http/curl-client/issues", - "source": "https://github.com/php-http/curl-client/tree/2.3.3" + "source": "https://github.com/php-http/curl-client/tree/2.4.0" }, - "time": "2024-10-31T07:36:58+00:00" + "time": "2025-12-09T12:02:56+00:00" }, { "name": "php-http/discovery", @@ -2292,16 +1952,16 @@ }, { "name": "psr/container", - "version": "1.1.2", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/php-fig/container.git", - "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", - "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", "shasum": "", "mirrors": [ { @@ -2314,6 +1974,11 @@ "php": ">=7.4.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, "autoload": { "psr-4": { "Psr\\Container\\": "src/" @@ -2340,9 +2005,61 @@ ], "support": { "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/1.1.2" + "source": "https://github.com/php-fig/container/tree/2.0.2" }, - "time": "2021-11-05T16:50:12+00:00" + "time": "2021-11-05T16:47:00+00:00" + }, + { + "name": "psr/event-dispatcher", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/event-dispatcher.git", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", + "shasum": "", + "mirrors": [ + { + "url": "https://repo.packagist.com/inpsyde/dists/%package%/%version%/r%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": ">=7.2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\EventDispatcher\\": "src/" + } + }, + "notification-url": "https://repo.packagist.com/inpsyde/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Standard interfaces for event handling.", + "keywords": [ + "events", + "psr", + "psr-14" + ], + "time": "2019-01-08T18:20:26+00:00" }, { "name": "psr/http-client", @@ -2580,16 +2297,16 @@ }, { "name": "sniccowp/php-scoper-wordpress-excludes", - "version": "6.8.1", + "version": "6.9.1", "source": { "type": "git", "url": "https://github.com/snicco/php-scoper-wordpress-excludes.git", - "reference": "c2c18f89a9aa2d7ef1998d233b9ed00d0deff5dd" + "reference": "94867711087d0efc3d361dbe068044e0124f4c0b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/snicco/php-scoper-wordpress-excludes/zipball/c2c18f89a9aa2d7ef1998d233b9ed00d0deff5dd", - "reference": "c2c18f89a9aa2d7ef1998d233b9ed00d0deff5dd", + "url": "https://api.github.com/repos/snicco/php-scoper-wordpress-excludes/zipball/94867711087d0efc3d361dbe068044e0124f4c0b", + "reference": "94867711087d0efc3d361dbe068044e0124f4c0b", "shasum": "", "mirrors": [ { @@ -2601,7 +2318,7 @@ "require-dev": { "php": "^7.4", "php-stubs/wordpress-globals": "0.2.0", - "php-stubs/wordpress-stubs": "6.8.1", + "php-stubs/wordpress-stubs": "6.9.1", "sniccowp/php-scoper-excludes": "dev-master" }, "type": "library", @@ -2627,9 +2344,9 @@ ], "support": { "issues": "https://github.com/snicco/php-scoper-wordpress-excludes/issues", - "source": "https://github.com/snicco/php-scoper-wordpress-excludes/tree/6.8.1" + "source": "https://github.com/snicco/php-scoper-wordpress-excludes/tree/6.9.1" }, - "time": "2025-05-03T00:01:53+00:00" + "time": "2026-02-04T00:34:47+00:00" }, { "name": "symfony/deprecation-contracts", @@ -2706,16 +2423,16 @@ }, { "name": "symfony/options-resolver", - "version": "v7.3.3", + "version": "v7.4.0", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "0ff2f5c3df08a395232bbc3c2eb7e84912df911d" + "reference": "b38026df55197f9e39a44f3215788edf83187b80" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/0ff2f5c3df08a395232bbc3c2eb7e84912df911d", - "reference": "0ff2f5c3df08a395232bbc3c2eb7e84912df911d", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/b38026df55197f9e39a44f3215788edf83187b80", + "reference": "b38026df55197f9e39a44f3215788edf83187b80", "shasum": "", "mirrors": [ { @@ -2759,7 +2476,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v7.3.3" + "source": "https://github.com/symfony/options-resolver/tree/v7.4.0" }, "funding": [ { @@ -2779,7 +2496,7 @@ "type": "tidelift" } ], - "time": "2025-08-05T10:16:07+00:00" + "time": "2025-11-12T15:39:26+00:00" }, { "name": "symfony/polyfill-php80", @@ -3432,16 +3149,16 @@ }, { "name": "brain/monkey", - "version": "2.6.2", + "version": "2.7.0", "source": { "type": "git", "url": "https://github.com/Brain-WP/BrainMonkey.git", - "reference": "d95a9d895352c30f47604ad1b825ab8fa9d1a373" + "reference": "ea3aeb3d559ba3c0930b3f4d210b665a4c044d83" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Brain-WP/BrainMonkey/zipball/d95a9d895352c30f47604ad1b825ab8fa9d1a373", - "reference": "d95a9d895352c30f47604ad1b825ab8fa9d1a373", + "url": "https://api.github.com/repos/Brain-WP/BrainMonkey/zipball/ea3aeb3d559ba3c0930b3f4d210b665a4c044d83", + "reference": "ea3aeb3d559ba3c0930b3f4d210b665a4c044d83", "shasum": "", "mirrors": [ { @@ -3452,19 +3169,19 @@ }, "require": { "antecedent/patchwork": "^2.1.17", - "mockery/mockery": "^1.3.5 || ^1.4.4", + "mockery/mockery": "~1.3.6 || ~1.4.4 || ~1.5.1 || ^1.6.10", "php": ">=5.6.0" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7.1", + "dealerdirect/phpcodesniffer-composer-installer": "^1.0.0", "phpcompatibility/php-compatibility": "^9.3.0", - "phpunit/phpunit": "^5.7.26 || ^6.0 || ^7.0 || >=8.0 <8.5.12 || ^8.5.14 || ^9.0" + "phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.49 || ^9.6.30" }, "type": "library", "extra": { "branch-alias": { - "dev-version/1": "1.x-dev", - "dev-master": "2.x-dev" + "dev-master": "2.x-dev", + "dev-version/1": "1.x-dev" } }, "autoload": { @@ -3504,7 +3221,7 @@ "issues": "https://github.com/Brain-WP/BrainMonkey/issues", "source": "https://github.com/Brain-WP/BrainMonkey" }, - "time": "2024-08-29T20:15:04+00:00" + "time": "2026-02-05T09:22:14+00:00" }, { "name": "composer/pcre", @@ -5145,16 +4862,16 @@ }, { "name": "phpoption/phpoption", - "version": "1.9.4", + "version": "1.9.5", "source": { "type": "git", "url": "https://github.com/schmittjoh/php-option.git", - "reference": "638a154f8d4ee6a5cfa96d6a34dfbe0cffa9566d" + "reference": "75365b91986c2405cf5e1e012c5595cd487a98be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/638a154f8d4ee6a5cfa96d6a34dfbe0cffa9566d", - "reference": "638a154f8d4ee6a5cfa96d6a34dfbe0cffa9566d", + "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/75365b91986c2405cf5e1e012c5595cd487a98be", + "reference": "75365b91986c2405cf5e1e012c5595cd487a98be", "shasum": "", "mirrors": [ { @@ -5210,7 +4927,7 @@ ], "support": { "issues": "https://github.com/schmittjoh/php-option/issues", - "source": "https://github.com/schmittjoh/php-option/tree/1.9.4" + "source": "https://github.com/schmittjoh/php-option/tree/1.9.5" }, "funding": [ { @@ -5222,7 +4939,7 @@ "type": "tidelift" } ], - "time": "2025-08-21T11:53:16+00:00" + "time": "2025-12-27T19:41:33+00:00" }, { "name": "phpstan/phpdoc-parser", @@ -6914,16 +6631,16 @@ }, { "name": "spatie/array-to-xml", - "version": "3.4.0", + "version": "3.4.4", "source": { "type": "git", "url": "https://github.com/spatie/array-to-xml.git", - "reference": "7dcfc67d60b0272926dabad1ec01f6b8a5fb5e67" + "reference": "88b2f3852a922dd73177a68938f8eb2ec70c7224" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/array-to-xml/zipball/7dcfc67d60b0272926dabad1ec01f6b8a5fb5e67", - "reference": "7dcfc67d60b0272926dabad1ec01f6b8a5fb5e67", + "url": "https://api.github.com/repos/spatie/array-to-xml/zipball/88b2f3852a922dd73177a68938f8eb2ec70c7224", + "reference": "88b2f3852a922dd73177a68938f8eb2ec70c7224", "shasum": "", "mirrors": [ { @@ -6972,7 +6689,7 @@ "xml" ], "support": { - "source": "https://github.com/spatie/array-to-xml/tree/3.4.0" + "source": "https://github.com/spatie/array-to-xml/tree/3.4.4" }, "funding": [ { @@ -6984,7 +6701,7 @@ "type": "github" } ], - "time": "2024-12-16T12:45:15+00:00" + "time": "2025-12-15T09:00:41+00:00" }, { "name": "squizlabs/php_codesniffer", @@ -7064,16 +6781,16 @@ }, { "name": "symfony/console", - "version": "v7.3.6", + "version": "v7.4.7", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "c28ad91448f86c5f6d9d2c70f0cf68bf135f252a" + "reference": "e1e6770440fb9c9b0cf725f81d1361ad1835329d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/c28ad91448f86c5f6d9d2c70f0cf68bf135f252a", - "reference": "c28ad91448f86c5f6d9d2c70f0cf68bf135f252a", + "url": "https://api.github.com/repos/symfony/console/zipball/e1e6770440fb9c9b0cf725f81d1361ad1835329d", + "reference": "e1e6770440fb9c9b0cf725f81d1361ad1835329d", "shasum": "", "mirrors": [ { @@ -7087,7 +6804,7 @@ "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-mbstring": "~1.0", "symfony/service-contracts": "^2.5|^3", - "symfony/string": "^7.2" + "symfony/string": "^7.2|^8.0" }, "conflict": { "symfony/dependency-injection": "<6.4", @@ -7101,16 +6818,16 @@ }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/config": "^6.4|^7.0", - "symfony/dependency-injection": "^6.4|^7.0", - "symfony/event-dispatcher": "^6.4|^7.0", - "symfony/http-foundation": "^6.4|^7.0", - "symfony/http-kernel": "^6.4|^7.0", - "symfony/lock": "^6.4|^7.0", - "symfony/messenger": "^6.4|^7.0", - "symfony/process": "^6.4|^7.0", - "symfony/stopwatch": "^6.4|^7.0", - "symfony/var-dumper": "^6.4|^7.0" + "symfony/config": "^6.4|^7.0|^8.0", + "symfony/dependency-injection": "^6.4|^7.0|^8.0", + "symfony/event-dispatcher": "^6.4|^7.0|^8.0", + "symfony/http-foundation": "^6.4|^7.0|^8.0", + "symfony/http-kernel": "^6.4|^7.0|^8.0", + "symfony/lock": "^6.4|^7.0|^8.0", + "symfony/messenger": "^6.4|^7.0|^8.0", + "symfony/process": "^6.4|^7.0|^8.0", + "symfony/stopwatch": "^6.4|^7.0|^8.0", + "symfony/var-dumper": "^6.4|^7.0|^8.0" }, "type": "library", "autoload": { @@ -7144,7 +6861,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.3.6" + "source": "https://github.com/symfony/console/tree/v7.4.7" }, "funding": [ { @@ -7164,20 +6881,20 @@ "type": "tidelift" } ], - "time": "2025-11-04T01:21:42+00:00" + "time": "2026-03-06T14:06:20+00:00" }, { "name": "symfony/filesystem", - "version": "v7.3.6", + "version": "v7.4.6", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "e9bcfd7837928ab656276fe00464092cc9e1826a" + "reference": "3ebc794fa5315e59fd122561623c2e2e4280538e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/e9bcfd7837928ab656276fe00464092cc9e1826a", - "reference": "e9bcfd7837928ab656276fe00464092cc9e1826a", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/3ebc794fa5315e59fd122561623c2e2e4280538e", + "reference": "3ebc794fa5315e59fd122561623c2e2e4280538e", "shasum": "", "mirrors": [ { @@ -7192,7 +6909,7 @@ "symfony/polyfill-mbstring": "~1.8" }, "require-dev": { - "symfony/process": "^6.4|^7.0" + "symfony/process": "^6.4|^7.0|^8.0" }, "type": "library", "autoload": { @@ -7220,7 +6937,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v7.3.6" + "source": "https://github.com/symfony/filesystem/tree/v7.4.6" }, "funding": [ { @@ -7240,7 +6957,7 @@ "type": "tidelift" } ], - "time": "2025-11-05T09:52:27+00:00" + "time": "2026-02-25T16:50:00+00:00" }, { "name": "symfony/polyfill-ctype", @@ -7603,16 +7320,16 @@ }, { "name": "symfony/service-contracts", - "version": "v3.6.0", + "version": "v3.6.1", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "f021b05a130d35510bd6b25fe9053c2a8a15d5d4" + "reference": "45112560a3ba2d715666a509a0bc9521d10b6c43" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/f021b05a130d35510bd6b25fe9053c2a8a15d5d4", - "reference": "f021b05a130d35510bd6b25fe9053c2a8a15d5d4", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/45112560a3ba2d715666a509a0bc9521d10b6c43", + "reference": "45112560a3ba2d715666a509a0bc9521d10b6c43", "shasum": "", "mirrors": [ { @@ -7672,7 +7389,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.6.0" + "source": "https://github.com/symfony/service-contracts/tree/v3.6.1" }, "funding": [ { @@ -7683,25 +7400,29 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2025-04-25T09:37:31+00:00" + "time": "2025-07-15T11:30:57+00:00" }, { "name": "symfony/string", - "version": "v7.3.4", + "version": "v7.4.6", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "f96476035142921000338bad71e5247fbc138872" + "reference": "9f209231affa85aa930a5e46e6eb03381424b30b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/f96476035142921000338bad71e5247fbc138872", - "reference": "f96476035142921000338bad71e5247fbc138872", + "url": "https://api.github.com/repos/symfony/string/zipball/9f209231affa85aa930a5e46e6eb03381424b30b", + "reference": "9f209231affa85aa930a5e46e6eb03381424b30b", "shasum": "", "mirrors": [ { @@ -7712,8 +7433,9 @@ }, "require": { "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3.0", "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-intl-grapheme": "~1.0", + "symfony/polyfill-intl-grapheme": "~1.33", "symfony/polyfill-intl-normalizer": "~1.0", "symfony/polyfill-mbstring": "~1.0" }, @@ -7721,11 +7443,11 @@ "symfony/translation-contracts": "<2.5" }, "require-dev": { - "symfony/emoji": "^7.1", - "symfony/http-client": "^6.4|^7.0", - "symfony/intl": "^6.4|^7.0", + "symfony/emoji": "^7.1|^8.0", + "symfony/http-client": "^6.4|^7.0|^8.0", + "symfony/intl": "^6.4|^7.0|^8.0", "symfony/translation-contracts": "^2.5|^3.0", - "symfony/var-exporter": "^6.4|^7.0" + "symfony/var-exporter": "^6.4|^7.0|^8.0" }, "type": "library", "autoload": { @@ -7764,7 +7486,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v7.3.4" + "source": "https://github.com/symfony/string/tree/v7.4.6" }, "funding": [ { @@ -7784,7 +7506,7 @@ "type": "tidelift" } ], - "time": "2025-09-11T14:36:48+00:00" + "time": "2026-02-09T09:33:46+00:00" }, { "name": "symfony/var-dumper", diff --git a/modules.local/inpsyde-debug/composer.json b/modules.local/inpsyde-debug/composer.json index d81970f..85d2be2 100644 --- a/modules.local/inpsyde-debug/composer.json +++ b/modules.local/inpsyde-debug/composer.json @@ -5,7 +5,7 @@ "prefer-stable": true, "require": { "php": "^7.4 | ^8.0", - "dhii/module-interface": "^0.2 || ^0.3", + "inpsyde/modularity": "^1.7", "psr/log": "^1.1", "ext-json": "*" }, diff --git a/modules.local/inpsyde-debug/module.php b/modules.local/inpsyde-debug/module.php index d77683d..b970a96 100644 --- a/modules.local/inpsyde-debug/module.php +++ b/modules.local/inpsyde-debug/module.php @@ -4,9 +4,8 @@ namespace Inpsyde\Debug; -use Dhii\Modular\Module\ModuleInterface; use Inpsyde\Debug\InpsydeDebugModule; -return static function (): ModuleInterface { +return static function (): InpsydeDebugModule { return new InpsydeDebugModule(); }; diff --git a/modules.local/inpsyde-debug/src/InpsydeDebugModule.php b/modules.local/inpsyde-debug/src/InpsydeDebugModule.php index 7d13494..6ec5ab3 100644 --- a/modules.local/inpsyde-debug/src/InpsydeDebugModule.php +++ b/modules.local/inpsyde-debug/src/InpsydeDebugModule.php @@ -4,29 +4,18 @@ namespace Inpsyde\Debug; -use Dhii\Container\ServiceProvider; -use Dhii\Modular\Module\ModuleInterface; -use Interop\Container\ServiceProviderInterface; -use Psr\Container\ContainerInterface; +use Inpsyde\Modularity\Module\ModuleClassNameIdTrait; +use Inpsyde\Modularity\Module\ServiceModule; -class InpsydeDebugModule implements ModuleInterface +class InpsydeDebugModule implements ServiceModule { + use ModuleClassNameIdTrait; /** * @inheritDoc */ - public function setup(): ServiceProviderInterface - { - return new ServiceProvider( - require __DIR__ . '/../services.php', - require __DIR__ . '/../extensions.php' - ); - } - - /** - * @inheritDoc - */ - public function run(ContainerInterface $container): void + public function services(): array { + return require __DIR__ . '/../services.php'; } } diff --git a/modules.local/inpsyde-http-client/composer.json b/modules.local/inpsyde-http-client/composer.json index ce6b6c3..c33a2a1 100644 --- a/modules.local/inpsyde-http-client/composer.json +++ b/modules.local/inpsyde-http-client/composer.json @@ -13,7 +13,7 @@ } ], "require": { - "dhii/module-interface": "^0.2 || ^0.3", + "inpsyde/modularity": "^1.7", "php-http/curl-client": "^2.1", "php-http/message": "^1.8", "nyholm/psr7": "^1.2", diff --git a/modules.local/inpsyde-http-client/module.php b/modules.local/inpsyde-http-client/module.php index 67bfb47..e7a2319 100644 --- a/modules.local/inpsyde-http-client/module.php +++ b/modules.local/inpsyde-http-client/module.php @@ -4,8 +4,6 @@ namespace Inpsyde\Http; -use Dhii\Modular\Module\ModuleInterface; - -return static function (): ModuleInterface { +return static function (): HttpClientModule { return new HttpClientModule(); }; diff --git a/modules.local/inpsyde-http-client/src/HttpClientModule.php b/modules.local/inpsyde-http-client/src/HttpClientModule.php index 7516f55..7fc80e1 100644 --- a/modules.local/inpsyde-http-client/src/HttpClientModule.php +++ b/modules.local/inpsyde-http-client/src/HttpClientModule.php @@ -4,29 +4,18 @@ namespace Inpsyde\Http; -use Dhii\Container\ServiceProvider; -use Dhii\Modular\Module\ModuleInterface; -use Interop\Container\ServiceProviderInterface; -use Psr\Container\ContainerInterface; +use Inpsyde\Modularity\Module\ModuleClassNameIdTrait; +use Inpsyde\Modularity\Module\ServiceModule; -class HttpClientModule implements ModuleInterface +class HttpClientModule implements ServiceModule { + use ModuleClassNameIdTrait; /** * @inheritDoc */ - public function setup(): ServiceProviderInterface - { - return new ServiceProvider( - require __DIR__ . '/../services.php', - require __DIR__ . '/../extensions.php' - ); - } - - /** - * @inheritDoc - */ - public function run(ContainerInterface $container): void + public function services(): array { + return require __DIR__ . '/../services.php'; } } diff --git a/modules.local/inpsyde-queue/composer.json b/modules.local/inpsyde-queue/composer.json index d409df1..5c3a538 100644 --- a/modules.local/inpsyde-queue/composer.json +++ b/modules.local/inpsyde-queue/composer.json @@ -5,8 +5,7 @@ "prefer-stable": true, "require": { "ext-json": "*", - "dhii/containers": "^0.1", - "dhii/module-interface": "^0.2 || ^0.3", + "inpsyde/modularity": "^1.7", "psr/log": "^1.1" }, "autoload": { diff --git a/modules.local/inpsyde-queue/module.php b/modules.local/inpsyde-queue/module.php index 6059e61..e6b000b 100644 --- a/modules.local/inpsyde-queue/module.php +++ b/modules.local/inpsyde-queue/module.php @@ -4,8 +4,6 @@ namespace Inpsyde\Queue; -use Dhii\Modular\Module\ModuleInterface; - -return static function (): ModuleInterface { +return static function (): QueueModule { return new QueueModule(); }; diff --git a/modules.local/inpsyde-queue/src/Queue/Job/JobContainer.php b/modules.local/inpsyde-queue/src/Queue/Job/JobContainer.php index bf26982..cc0e82a 100644 --- a/modules.local/inpsyde-queue/src/Queue/Job/JobContainer.php +++ b/modules.local/inpsyde-queue/src/Queue/Job/JobContainer.php @@ -28,7 +28,7 @@ public function __construct(ContainerInterface $parent, string $prefix) /** * @inheritDoc */ - public function get($id) + public function get(string $id) { return $this->parent->get("{$this->prefix}.$id"); } @@ -36,7 +36,7 @@ public function get($id) /** * @inheritDoc */ - public function has($id) + public function has(string $id): bool { return $this->parent->has("{$this->prefix}.$id"); } diff --git a/modules.local/inpsyde-queue/src/QueueLibrary.php b/modules.local/inpsyde-queue/src/QueueLibrary.php index 62108ba..4c335cf 100644 --- a/modules.local/inpsyde-queue/src/QueueLibrary.php +++ b/modules.local/inpsyde-queue/src/QueueLibrary.php @@ -4,25 +4,21 @@ namespace Inpsyde\Queue; -use Dhii\Container\CompositeCachingServiceProvider; -use Dhii\Container\DelegatingContainer; -use Dhii\Container\ServiceProvider; -use Dhii\Modular\Module\Exception\ModuleExceptionInterface; +use Inpsyde\Modularity\Module\ExtendingModule; +use Inpsyde\Modularity\Module\ModuleClassNameIdTrait; +use Inpsyde\Modularity\Module\ServiceModule; +use Inpsyde\Modularity\Package; +use Inpsyde\Modularity\Properties\LibraryProperties; use Psr\Container\ContainerInterface; class QueueLibrary { /** - * @var DelegatingContainer + * @var ContainerInterface */ private $container; - /** - * @var CompositeCachingServiceProvider - */ - private $provider; - /** * @var QueueModule */ @@ -33,21 +29,51 @@ class QueueLibrary * * @param array $factories * @param array $extensions - * - * @throws ModuleExceptionInterface */ public function __construct(array $factories = [], array $extensions = []) { $this->module = new QueueModule(); - $providers = [$this->module->setup()]; - $providers[] = new ServiceProvider($factories, $extensions); - $this->provider = new CompositeCachingServiceProvider($providers); - $this->container = new DelegatingContainer($this->provider); + $package = Package::new(LibraryProperties::new(__DIR__ . '/../composer.json')); + $package->addModule($this->module); + + if ($factories !== [] || $extensions !== []) { + $package->addModule( + new class ($factories, $extensions) implements ServiceModule, ExtendingModule { + use ModuleClassNameIdTrait; + + /** + * @var array + */ + private $factories; + + /** + * @var array + */ + private $extensions; + + public function __construct(array $factories, array $extensions) + { + $this->factories = $factories; + $this->extensions = $extensions; + } + + public function services(): array + { + return $this->factories; + } + + public function extensions(): array + { + return $this->extensions; + } + } + ); + } + + $package->build(); + $this->container = $package->container(); } - /** - * @throws ModuleExceptionInterface - */ public function initialize() { $this->module->run($this->container()); diff --git a/modules.local/inpsyde-queue/src/QueueModule.php b/modules.local/inpsyde-queue/src/QueueModule.php index 2a32ece..d017466 100644 --- a/modules.local/inpsyde-queue/src/QueueModule.php +++ b/modules.local/inpsyde-queue/src/QueueModule.php @@ -4,36 +4,29 @@ namespace Inpsyde\Queue; -use Dhii\Container\ServiceProvider; -use Dhii\Modular\Module\ModuleInterface; +use Inpsyde\Modularity\Module\ExecutableModule; +use Inpsyde\Modularity\Module\ModuleClassNameIdTrait; +use Inpsyde\Modularity\Module\ServiceModule; use Inpsyde\Queue\Cli\QueueCommand; use Inpsyde\Queue\Processor\QueueProcessor; use Inpsyde\Queue\Queue\Runner\Runner; -use Interop\Container\ServiceProviderInterface; use Psr\Container\ContainerInterface; use WP_CLI; use WP_REST_Server; -class QueueModule implements ModuleInterface +class QueueModule implements ServiceModule, ExecutableModule { + use ModuleClassNameIdTrait; - /** - * @inheritDoc - */ - public function setup(): ServiceProviderInterface + public function services(): array { - return new ServiceProvider( - require __DIR__ . '/../services.php', - [] - ); + return require __DIR__ . '/../services.php'; } /** - * @inheritDoc - * * phpcs:disable Inpsyde.CodeQuality.FunctionLength.TooLong */ - public function run(ContainerInterface $container): void + public function run(ContainerInterface $container): bool { $namespace = $container->get('inpsyde.queue.namespace'); @@ -91,5 +84,7 @@ static function () use ($container) { ); } ); + + return true; } } diff --git a/modules.local/inpsyde-queue/tests/PHPUnit/Helper/QueueStandaloneTestCase.php b/modules.local/inpsyde-queue/tests/PHPUnit/Helper/QueueStandaloneTestCase.php index 42ca47c..4257645 100644 --- a/modules.local/inpsyde-queue/tests/PHPUnit/Helper/QueueStandaloneTestCase.php +++ b/modules.local/inpsyde-queue/tests/PHPUnit/Helper/QueueStandaloneTestCase.php @@ -7,7 +7,6 @@ namespace Inpsyde\Queue\Tests; -use Dhii\Modular\Module\Exception\ModuleExceptionInterface; use Inpsyde\Queue\QueueLibrary; use MonkeryTestCase\BrainMonkeyWpTestCase; use Psr\Container\ContainerInterface; @@ -24,9 +23,6 @@ class QueueStandaloneTestCase extends BrainMonkeyWpTestCase private $currentExtensions = []; - /** - * @throws ModuleExceptionInterface - */ protected function setUp(): void { $standalone = new QueueLibrary($this->currentFactories, $this->currentExtensions); diff --git a/modules.local/inpsyde-state-machine/composer.json b/modules.local/inpsyde-state-machine/composer.json index 3ef5a8c..fa85cf8 100755 --- a/modules.local/inpsyde-state-machine/composer.json +++ b/modules.local/inpsyde-state-machine/composer.json @@ -4,9 +4,8 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "dhii/containers": "^0.1", - "dhii/module-interface": "^0.2 || ^0.3", - "dhii/event-dispatcher-interface": "0.1.0-alpha1" + "inpsyde/modularity": "^1.7", + "psr/event-dispatcher": "^1.0" }, "require-dev": { "phpunit/phpunit": "^8.0 || ^9.0", diff --git a/modules.local/inpsyde-state-machine/services.php b/modules.local/inpsyde-state-machine/services.php index 5a8a1ae..252750d 100644 --- a/modules.local/inpsyde-state-machine/services.php +++ b/modules.local/inpsyde-state-machine/services.php @@ -4,8 +4,8 @@ namespace Inpsyde\StateMachine; -use Dhii\Events\Listener\ListenerProviderInterface; use Inpsyde\StateMachine\Event\AggregateProvider; +use Psr\EventDispatcher\ListenerProviderInterface; use Inpsyde\StateMachine\Event\EventDispatcher; use Inpsyde\StateMachine\Event\ListenerProvider; use Inpsyde\StateMachine\Event\StateAwareListenerProvider; diff --git a/modules.local/inpsyde-state-machine/src/Event/AggregateProvider.php b/modules.local/inpsyde-state-machine/src/Event/AggregateProvider.php index b6bd8ad..b1e0a65 100755 --- a/modules.local/inpsyde-state-machine/src/Event/AggregateProvider.php +++ b/modules.local/inpsyde-state-machine/src/Event/AggregateProvider.php @@ -4,13 +4,8 @@ namespace Inpsyde\StateMachine\Event; -use Dhii\Events\Listener\ListenerProviderInterface; -use Traversable; +use Psr\EventDispatcher\ListenerProviderInterface; -/** - * This can be removed and replaced by fig/event-dispatcher-util's - * implementation once the switch to PHP7.2 allows using PSR-14 - */ class AggregateProvider implements ListenerProviderInterface { @@ -20,13 +15,9 @@ class AggregateProvider implements ListenerProviderInterface protected $providers = []; /** - * phpcs:disable Inpsyde.CodeQuality.ArgumentTypeDeclaration.NoArgumentType * phpcs:disable Inpsyde.CodeQuality.NoAccessors.NoGetter - * @param object $event - * - * @return Traversable */ - public function getListenersForEvent($event): Traversable + public function getListenersForEvent(object $event): iterable { /** @var ListenerProviderInterface $provider */ foreach ($this->providers as $provider) { diff --git a/modules.local/inpsyde-state-machine/src/Event/EventDispatcher.php b/modules.local/inpsyde-state-machine/src/Event/EventDispatcher.php index 67e1a59..34bbeda 100755 --- a/modules.local/inpsyde-state-machine/src/Event/EventDispatcher.php +++ b/modules.local/inpsyde-state-machine/src/Event/EventDispatcher.php @@ -4,8 +4,8 @@ namespace Inpsyde\StateMachine\Event; -use Dhii\Events\Dispatcher\EventDispatcherInterface; -use Dhii\Events\Listener\ListenerProviderInterface; +use Psr\EventDispatcher\EventDispatcherInterface; +use Psr\EventDispatcher\ListenerProviderInterface; class EventDispatcher implements EventDispatcherInterface { @@ -20,14 +20,7 @@ public function __construct(ListenerProviderInterface ...$listenerProviders) $this->listenerProviders = $listenerProviders; } - /** - * @param object $event - * phpcs:disable Inpsyde.CodeQuality.ArgumentTypeDeclaration.NoArgumentType - * phpcs:disable Inpsyde.CodeQuality.ReturnTypeDeclaration.NoReturnType - * - * @return object - */ - public function dispatch($event) + public function dispatch(object $event): object { foreach ($this->listenerProviders as $listenerProvider) { $listeners = $listenerProvider->getListenersForEvent($event); diff --git a/modules.local/inpsyde-state-machine/src/Event/ListenerProvider.php b/modules.local/inpsyde-state-machine/src/Event/ListenerProvider.php index 70160ce..17e803f 100755 --- a/modules.local/inpsyde-state-machine/src/Event/ListenerProvider.php +++ b/modules.local/inpsyde-state-machine/src/Event/ListenerProvider.php @@ -4,9 +4,8 @@ namespace Inpsyde\StateMachine\Event; -use Dhii\Events\Event\IsPropagationStoppedCapableInterface; -use Dhii\Events\Listener\ListenerProviderInterface; -use Traversable; +use Psr\EventDispatcher\ListenerProviderInterface; +use Psr\EventDispatcher\StoppableEventInterface; class ListenerProvider implements ListenerProviderInterface { @@ -25,19 +24,15 @@ public function addListener(callable $listener) } /** - * @param object $event - * phpcs:disable Inpsyde.CodeQuality.ArgumentTypeDeclaration.NoArgumentType * phpcs:disable Inpsyde.CodeQuality.NoAccessors.NoGetter - * - * @return Traversable */ - public function getListenersForEvent($event): Traversable + public function getListenersForEvent(object $event): iterable { $eventType = get_class($event); $extends = class_parents($event); $implements = class_implements($event); foreach ($this->listeners as $listener) { - if ($event instanceof IsPropagationStoppedCapableInterface && $event->isPropagationStopped()) { + if ($event instanceof StoppableEventInterface && $event->isPropagationStopped()) { break; } $type = $this->getParameterType($listener); diff --git a/modules.local/inpsyde-state-machine/src/Event/StateAwareListenerProvider.php b/modules.local/inpsyde-state-machine/src/Event/StateAwareListenerProvider.php index 8a249d3..abc7881 100755 --- a/modules.local/inpsyde-state-machine/src/Event/StateAwareListenerProvider.php +++ b/modules.local/inpsyde-state-machine/src/Event/StateAwareListenerProvider.php @@ -4,8 +4,7 @@ namespace Inpsyde\StateMachine\Event; -use Dhii\Events\Listener\ListenerProviderInterface; -use Traversable; +use Psr\EventDispatcher\ListenerProviderInterface; class StateAwareListenerProvider implements ListenerProviderInterface { @@ -24,13 +23,10 @@ public function listen(string $state, callable $listener) } /** - * @param object $event - * phpcs:disable Inpsyde.CodeQuality.ArgumentTypeDeclaration.NoArgumentType * phpcs:disable Inpsyde.CodeQuality.NoAccessors.NoGetter * phpcs:disable Inpsyde.CodeQuality.ReturnTypeDeclaration.InvalidGeneratorManyReturns - * @return Traversable */ - public function getListenersForEvent($event): Traversable + public function getListenersForEvent(object $event): iterable { if (!($event instanceof StateChange)) { return yield from []; diff --git a/modules.local/inpsyde-state-machine/src/Event/StateChange.php b/modules.local/inpsyde-state-machine/src/Event/StateChange.php index 3f00f3e..5b378c3 100755 --- a/modules.local/inpsyde-state-machine/src/Event/StateChange.php +++ b/modules.local/inpsyde-state-machine/src/Event/StateChange.php @@ -4,10 +4,10 @@ namespace Inpsyde\StateMachine\Event; -use Dhii\Events\Event\IsPropagationStoppedCapableInterface; use Inpsyde\StateMachine\StateMachineInterface; +use Psr\EventDispatcher\StoppableEventInterface; -interface StateChange extends IsPropagationStoppedCapableInterface +interface StateChange extends StoppableEventInterface { public function prepare(StateMachineInterface $stateMachine); diff --git a/modules.local/inpsyde-state-machine/src/Event/TransitionAwareListenerProvider.php b/modules.local/inpsyde-state-machine/src/Event/TransitionAwareListenerProvider.php index 5366ded..b5a7a42 100755 --- a/modules.local/inpsyde-state-machine/src/Event/TransitionAwareListenerProvider.php +++ b/modules.local/inpsyde-state-machine/src/Event/TransitionAwareListenerProvider.php @@ -4,8 +4,7 @@ namespace Inpsyde\StateMachine\Event; -use Dhii\Events\Listener\ListenerProviderInterface; -use Traversable; +use Psr\EventDispatcher\ListenerProviderInterface; class TransitionAwareListenerProvider implements ListenerProviderInterface { @@ -29,13 +28,10 @@ public function listen(string $state, $listener) } /** - * @param object $event - * phpcs:disable Inpsyde.CodeQuality.ArgumentTypeDeclaration.NoArgumentType * phpcs:disable Inpsyde.CodeQuality.NoAccessors.NoGetter * phpcs:disable Inpsyde.CodeQuality.ReturnTypeDeclaration.InvalidGeneratorManyReturns - * @return Traversable */ - public function getListenersForEvent($event): Traversable + public function getListenersForEvent(object $event): iterable { if (!($event instanceof PostTransition || $event instanceof PreTransition)) { return yield from []; diff --git a/modules.local/inpsyde-state-machine/src/StateMachine.php b/modules.local/inpsyde-state-machine/src/StateMachine.php index 2674b5d..ac48af4 100644 --- a/modules.local/inpsyde-state-machine/src/StateMachine.php +++ b/modules.local/inpsyde-state-machine/src/StateMachine.php @@ -4,7 +4,7 @@ namespace Inpsyde\StateMachine; -use Dhii\Events\Dispatcher\EventDispatcherInterface; +use Psr\EventDispatcher\EventDispatcherInterface; use Inpsyde\StateMachine\Event\GenericPostTransition; use Inpsyde\StateMachine\Event\GenericPreTransition; use Inpsyde\StateMachine\Event\StateChange; diff --git a/modules.local/inpsyde-state-machine/src/StateMachineLibrary.php b/modules.local/inpsyde-state-machine/src/StateMachineLibrary.php index 6ac0b69..ca389ab 100644 --- a/modules.local/inpsyde-state-machine/src/StateMachineLibrary.php +++ b/modules.local/inpsyde-state-machine/src/StateMachineLibrary.php @@ -4,10 +4,11 @@ namespace Inpsyde\StateMachine; -use Dhii\Container\CompositeCachingServiceProvider; -use Dhii\Container\DelegatingContainer; -use Dhii\Container\ServiceProvider; -use Dhii\Modular\Module\Exception\ModuleExceptionInterface; +use Inpsyde\Modularity\Module\ExtendingModule; +use Inpsyde\Modularity\Module\ModuleClassNameIdTrait; +use Inpsyde\Modularity\Module\ServiceModule; +use Inpsyde\Modularity\Package; +use Inpsyde\Modularity\Properties\LibraryProperties; use Psr\Container\ContainerInterface; /** @@ -22,15 +23,10 @@ class StateMachineLibrary { /** - * @var DelegatingContainer + * @var ContainerInterface */ private $container; - /** - * @var CompositeCachingServiceProvider - */ - private $provider; - /** * @var StateMachineModule */ @@ -41,21 +37,51 @@ class StateMachineLibrary * * @param array $factories Overrides for dafault factories * @param array $extensions Extensions for default factories - * - * @throws ModuleExceptionInterface */ public function __construct(array $factories = [], array $extensions = []) { $this->module = new StateMachineModule(); - $providers = [$this->module->setup()]; - $providers[] = new ServiceProvider($factories, $extensions); - $this->provider = new CompositeCachingServiceProvider($providers); - $this->container = new DelegatingContainer($this->provider); + $package = Package::new(LibraryProperties::new(__DIR__ . '/../composer.json')); + $package->addModule($this->module); + + if ($factories !== [] || $extensions !== []) { + $package->addModule( + new class ($factories, $extensions) implements ServiceModule, ExtendingModule { + use ModuleClassNameIdTrait; + + /** + * @var array + */ + private $factories; + + /** + * @var array + */ + private $extensions; + + public function __construct(array $factories, array $extensions) + { + $this->factories = $factories; + $this->extensions = $extensions; + } + + public function services(): array + { + return $this->factories; + } + + public function extensions(): array + { + return $this->extensions; + } + } + ); + } + + $package->build(); + $this->container = $package->container(); } - /** - * @throws ModuleExceptionInterface - */ public function initialize() { $this->module->run($this->container()); diff --git a/modules.local/inpsyde-state-machine/src/StateMachineModule.php b/modules.local/inpsyde-state-machine/src/StateMachineModule.php index a376365..f85c514 100644 --- a/modules.local/inpsyde-state-machine/src/StateMachineModule.php +++ b/modules.local/inpsyde-state-machine/src/StateMachineModule.php @@ -4,29 +4,22 @@ namespace Inpsyde\StateMachine; -use Dhii\Container\ServiceProvider; -use Dhii\Modular\Module\ModuleInterface; -use Interop\Container\ServiceProviderInterface; +use Inpsyde\Modularity\Module\ExecutableModule; +use Inpsyde\Modularity\Module\ModuleClassNameIdTrait; +use Inpsyde\Modularity\Module\ServiceModule; use Psr\Container\ContainerInterface; -class StateMachineModule implements ModuleInterface +class StateMachineModule implements ServiceModule, ExecutableModule { + use ModuleClassNameIdTrait; - /** - * @inheritDoc - */ - public function setup(): ServiceProviderInterface + public function services(): array { - return new ServiceProvider( - require __DIR__ . '/../services.php', - require __DIR__ . '/../extensions.php' - ); + return require __DIR__ . '/../services.php'; } - /** - * @inheritDoc - */ - public function run(ContainerInterface $container): void + public function run(ContainerInterface $container): bool { + return true; } } diff --git a/modules.local/inpsyde-state-machine/tests/PHPUnit/Helper/StateMachineStandaloneTestCase.php b/modules.local/inpsyde-state-machine/tests/PHPUnit/Helper/StateMachineStandaloneTestCase.php index f63c3b1..f6a9b58 100644 --- a/modules.local/inpsyde-state-machine/tests/PHPUnit/Helper/StateMachineStandaloneTestCase.php +++ b/modules.local/inpsyde-state-machine/tests/PHPUnit/Helper/StateMachineStandaloneTestCase.php @@ -7,7 +7,6 @@ namespace Inpsyde\StateMachine\Test; -use Dhii\Modular\Module\Exception\ModuleExceptionInterface; use Inpsyde\StateMachine\StateMachineLibrary; use MonkeryTestCase\BrainMonkeyWpTestCase; use Psr\Container\ContainerInterface; @@ -24,9 +23,6 @@ class StateMachineStandaloneTestCase extends BrainMonkeyWpTestCase private $currentExtensions = []; - /** - * @throws ModuleExceptionInterface - */ protected function setUp(): void { $standalone = new StateMachineLibrary($this->currentFactories, $this->currentExtensions); diff --git a/modules.local/inpsyde-state-machine/tests/PHPUnit/Integration/NamespacedStateMachineTest.php b/modules.local/inpsyde-state-machine/tests/PHPUnit/Integration/NamespacedStateMachineTest.php index b82fcae..73cb686 100644 --- a/modules.local/inpsyde-state-machine/tests/PHPUnit/Integration/NamespacedStateMachineTest.php +++ b/modules.local/inpsyde-state-machine/tests/PHPUnit/Integration/NamespacedStateMachineTest.php @@ -57,8 +57,8 @@ function (): array { "inpsyde.state-machine.events.listener-provider.transition-aware", $this->single( function ( - ContainerInterface $container, - TransitionAwareListenerProvider $listenerProvider + TransitionAwareListenerProvider $listenerProvider, + ContainerInterface $container ): TransitionAwareListenerProvider { $listenerProvider->listen('baz', function (PreTransition $event): void { $this->preTransitionEvent = $event; diff --git a/modules.local/inpsyde-wc-status-report/composer.json b/modules.local/inpsyde-wc-status-report/composer.json index 9e441ad..c4d4ee6 100644 --- a/modules.local/inpsyde-wc-status-report/composer.json +++ b/modules.local/inpsyde-wc-status-report/composer.json @@ -3,7 +3,7 @@ "type": "inpsyde-module", "minimum-stability": "dev", "require": { - "dhii/module-interface": "^0.2 || ^0.3" + "inpsyde/modularity": "^1.7" }, "require-dev": { "brianium/paratest": "^4.0 || ^6.0", diff --git a/modules.local/inpsyde-wc-status-report/module.php b/modules.local/inpsyde-wc-status-report/module.php index 914c960..ba44314 100644 --- a/modules.local/inpsyde-wc-status-report/module.php +++ b/modules.local/inpsyde-wc-status-report/module.php @@ -4,8 +4,6 @@ namespace Inpsyde\WcStatusReport; -use Dhii\Modular\Module\ModuleInterface; - -return static function (): ModuleInterface { +return static function (): WcStatusReportModule { return new WcStatusReportModule(); }; diff --git a/modules.local/inpsyde-wc-status-report/src/WcStatusReportModule.php b/modules.local/inpsyde-wc-status-report/src/WcStatusReportModule.php index f151508..6883a05 100644 --- a/modules.local/inpsyde-wc-status-report/src/WcStatusReportModule.php +++ b/modules.local/inpsyde-wc-status-report/src/WcStatusReportModule.php @@ -4,29 +4,27 @@ namespace Inpsyde\WcStatusReport; -use Dhii\Container\ServiceProvider; -use Dhii\Modular\Module\ModuleInterface; -use Interop\Container\ServiceProviderInterface; +use Inpsyde\Modularity\Module\ExecutableModule; +use Inpsyde\Modularity\Module\ModuleClassNameIdTrait; +use Inpsyde\Modularity\Module\ServiceModule; use Psr\Container\ContainerInterface; -class WcStatusReportModule implements ModuleInterface +class WcStatusReportModule implements ServiceModule, ExecutableModule { + use ModuleClassNameIdTrait; /** * @inheritDoc */ - public function setup(): ServiceProviderInterface + public function services(): array { - return new ServiceProvider( - require __DIR__ . '/../services.php', - require __DIR__ . '/../extensions.php' - ); + return require __DIR__ . '/../services.php'; } /** * @inheritDoc */ - public function run(ContainerInterface $container): void + public function run(ContainerInterface $container): bool { $renderer = $container->get('inpsyde.wc-status-report.renderer'); assert($renderer instanceof StatusReportRendererInterface); @@ -35,5 +33,7 @@ public function run(ContainerInterface $container): void // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $renderer->render($container->get('inpsyde.wc-status-report.report')); }, 20); + + return true; } } diff --git a/modules.local/inpsyde-woocommerce-lifecycle-events/composer.json b/modules.local/inpsyde-woocommerce-lifecycle-events/composer.json index 4545d22..1a07bb2 100644 --- a/modules.local/inpsyde-woocommerce-lifecycle-events/composer.json +++ b/modules.local/inpsyde-woocommerce-lifecycle-events/composer.json @@ -4,8 +4,7 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "dhii/containers": "^0.1", - "dhii/module-interface": "^0.2 || ^0.3" + "inpsyde/modularity": "^1.7" }, "autoload": { "psr-4": { diff --git a/modules.local/inpsyde-woocommerce-lifecycle-events/extensions.php b/modules.local/inpsyde-woocommerce-lifecycle-events/extensions.php index 4f8e2c9..68fce0a 100644 --- a/modules.local/inpsyde-woocommerce-lifecycle-events/extensions.php +++ b/modules.local/inpsyde-woocommerce-lifecycle-events/extensions.php @@ -12,8 +12,8 @@ return [ 'inpsyde.wc-lifecycle-events.products.listener-provider' => static function ( - ContainerInterface $container, - ProductEventListenerRegistry $provider + ProductEventListenerRegistry $provider, + ContainerInterface $container ): ProductEventListenerRegistry { /** * The following hooks are temporarily left here for testing and diff --git a/modules.local/inpsyde-woocommerce-lifecycle-events/module.php b/modules.local/inpsyde-woocommerce-lifecycle-events/module.php index 47f81af..952c2cb 100644 --- a/modules.local/inpsyde-woocommerce-lifecycle-events/module.php +++ b/modules.local/inpsyde-woocommerce-lifecycle-events/module.php @@ -4,8 +4,6 @@ namespace Inpsyde\WcEvents; -use Dhii\Modular\Module\ModuleInterface; - -return static function (): ModuleInterface { +return static function (): WcEventsModule { return new WcEventsModule(); }; diff --git a/modules.local/inpsyde-woocommerce-lifecycle-events/src/WcEventsLibrary.php b/modules.local/inpsyde-woocommerce-lifecycle-events/src/WcEventsLibrary.php index 87519b0..0d742d3 100644 --- a/modules.local/inpsyde-woocommerce-lifecycle-events/src/WcEventsLibrary.php +++ b/modules.local/inpsyde-woocommerce-lifecycle-events/src/WcEventsLibrary.php @@ -4,10 +4,11 @@ namespace Inpsyde\WcEvents; -use Dhii\Container\CompositeCachingServiceProvider; -use Dhii\Container\DelegatingContainer; -use Dhii\Container\ServiceProvider; -use Dhii\Modular\Module\Exception\ModuleExceptionInterface; +use Inpsyde\Modularity\Module\ExtendingModule; +use Inpsyde\Modularity\Module\ModuleClassNameIdTrait; +use Inpsyde\Modularity\Module\ServiceModule; +use Inpsyde\Modularity\Package; +use Inpsyde\Modularity\Properties\LibraryProperties; use Psr\Container\ContainerInterface; /** @@ -17,40 +18,65 @@ class WcEventsLibrary { /** - * @var DelegatingContainer + * @var ContainerInterface */ private $container; - /** - * @var CompositeCachingServiceProvider - */ - private $provider; - /** * @var WcEventsModule */ private $module; /** - * QueueLibrary constructor. + * WcEventsLibrary constructor. * * @param array $factories * @param array $extensions - * - * @throws ModuleExceptionInterface */ public function __construct(array $factories = [], array $extensions = []) { $this->module = new WcEventsModule(); - $providers = [$this->module->setup()]; - $providers[] = new ServiceProvider($factories, $extensions); - $this->provider = new CompositeCachingServiceProvider($providers); - $this->container = new DelegatingContainer($this->provider); + $package = Package::new(LibraryProperties::new(__DIR__ . '/../composer.json')); + $package->addModule($this->module); + + if ($factories !== [] || $extensions !== []) { + $package->addModule( + new class ($factories, $extensions) implements ServiceModule, ExtendingModule { + use ModuleClassNameIdTrait; + + /** + * @var array + */ + private $factories; + + /** + * @var array + */ + private $extensions; + + public function __construct(array $factories, array $extensions) + { + $this->factories = $factories; + $this->extensions = $extensions; + } + + public function services(): array + { + return $this->factories; + } + + public function extensions(): array + { + return $this->extensions; + } + } + ); + } + + $package->build(); + $this->container = $package->container(); } - /** - * @throws ModuleExceptionInterface - */ public function initialize() { $this->module->run($this->container()); diff --git a/modules.local/inpsyde-woocommerce-lifecycle-events/src/WcEventsModule.php b/modules.local/inpsyde-woocommerce-lifecycle-events/src/WcEventsModule.php index 5c57c0d..a24751e 100644 --- a/modules.local/inpsyde-woocommerce-lifecycle-events/src/WcEventsModule.php +++ b/modules.local/inpsyde-woocommerce-lifecycle-events/src/WcEventsModule.php @@ -4,36 +4,36 @@ namespace Inpsyde\WcEvents; -use Dhii\Container\ServiceProvider; -use Dhii\Modular\Module\ModuleInterface; +use Inpsyde\Modularity\Module\ExecutableModule; +use Inpsyde\Modularity\Module\ExtendingModule; +use Inpsyde\Modularity\Module\ModuleClassNameIdTrait; +use Inpsyde\Modularity\Module\ServiceModule; use Inpsyde\WcEvents\Hooks\ProductHooks; -use Interop\Container\ServiceProviderInterface; use Psr\Container\ContainerInterface; /** * Contains service definitions and bootstrapping logic of this module */ -class WcEventsModule implements ModuleInterface +class WcEventsModule implements ServiceModule, ExtendingModule, ExecutableModule { + use ModuleClassNameIdTrait; - /** - * @inheritDoc - */ - public function setup(): ServiceProviderInterface + public function services(): array { - return new ServiceProvider( - require __DIR__ . '/../services.php', - require __DIR__ . '/../extensions.php' - ); + return require __DIR__ . '/../services.php'; } - /** - * @inheritDoc - */ - public function run(ContainerInterface $container): void + public function extensions(): array + { + return require __DIR__ . '/../extensions.php'; + } + + public function run(ContainerInterface $container): bool { $eventDispatcher = $container->get('inpsyde.wc-lifecycle-events.products.hooks'); assert($eventDispatcher instanceof ProductHooks); $eventDispatcher->register(); + + return true; } } diff --git a/modules.local/paypal-pos-assets/composer.json b/modules.local/paypal-pos-assets/composer.json index 7108218..5852d63 100644 --- a/modules.local/paypal-pos-assets/composer.json +++ b/modules.local/paypal-pos-assets/composer.json @@ -2,7 +2,7 @@ "name": "inpsyde/paypal-pos-assets", "type": "inpsyde-module", "require": { - "dhii/module-interface": "^0.2 || ^0.3", + "inpsyde/modularity": "^1.7", "inpsyde/assets": "^2.1" }, "autoload": { diff --git a/modules.local/paypal-pos-assets/extensions.php b/modules.local/paypal-pos-assets/extensions.php index 807cb01..b35d9a5 100644 --- a/modules.local/paypal-pos-assets/extensions.php +++ b/modules.local/paypal-pos-assets/extensions.php @@ -14,7 +14,7 @@ use Psr\Container\ContainerInterface as C; return [ - 'inpsyde.assets.registry' => static function (C $container, array $previous): array { + 'inpsyde.assets.registry' => static function (array $previous, C $container): array { $assetUri = rtrim(plugins_url('/assets/', __DIR__ . '/paypal-point-of-sale.php'), '/\\'); if ($container->get('paypal-pos.assets.should-enqueue.all')()) { diff --git a/modules.local/paypal-pos-assets/module.php b/modules.local/paypal-pos-assets/module.php index 96d13d6..e3c1dd6 100644 --- a/modules.local/paypal-pos-assets/module.php +++ b/modules.local/paypal-pos-assets/module.php @@ -4,8 +4,6 @@ namespace Syde\PayPal\PointOfSale\Assets; -use Dhii\Modular\Module\ModuleInterface; - -return static function (): ModuleInterface { +return static function (): AssetsModule { return new AssetsModule(); }; diff --git a/modules.local/paypal-pos-assets/src/AssetsModule.php b/modules.local/paypal-pos-assets/src/AssetsModule.php index e1815c5..e46fb07 100644 --- a/modules.local/paypal-pos-assets/src/AssetsModule.php +++ b/modules.local/paypal-pos-assets/src/AssetsModule.php @@ -4,28 +4,27 @@ namespace Syde\PayPal\PointOfSale\Assets; -use Dhii\Container\ServiceProvider; -use Dhii\Modular\Module\ModuleInterface; -use Interop\Container\ServiceProviderInterface; -use Psr\Container\ContainerInterface; +use Inpsyde\Modularity\Module\ExtendingModule; +use Inpsyde\Modularity\Module\ModuleClassNameIdTrait; +use Inpsyde\Modularity\Module\ServiceModule; -class AssetsModule implements ModuleInterface +class AssetsModule implements ServiceModule, ExtendingModule { + use ModuleClassNameIdTrait; + /** * @inheritDoc */ - public function setup(): ServiceProviderInterface + public function services(): array { - return new ServiceProvider( - require __DIR__ . '/../services.php', - require __DIR__ . '/../extensions.php' - ); + return require __DIR__ . '/../services.php'; } /** * @inheritDoc */ - public function run(ContainerInterface $container): void + public function extensions(): array { + return require __DIR__ . '/../extensions.php'; } } diff --git a/modules.local/paypal-pos-auth/composer.json b/modules.local/paypal-pos-auth/composer.json index 68e0223..c4fed44 100644 --- a/modules.local/paypal-pos-auth/composer.json +++ b/modules.local/paypal-pos-auth/composer.json @@ -4,7 +4,7 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "dhii/module-interface": "^0.2 || ^0.3", + "inpsyde/modularity": "^1.7", "psr/http-client": "^1.0", "ext-openssl": "*" }, diff --git a/modules.local/paypal-pos-auth/extensions.php b/modules.local/paypal-pos-auth/extensions.php index f44cc86..f4cdb36 100644 --- a/modules.local/paypal-pos-auth/extensions.php +++ b/modules.local/paypal-pos-auth/extensions.php @@ -10,7 +10,7 @@ return [ 'inpsyde.http-client.plugins' => - static function (ContainerInterface $container, array $previous): array { + static function (array $previous, ContainerInterface $container): array { $previous[] = $container->get('paypal-pos.http-plug.plugin'); if (getenv('IZETTLE_CHAOS_MONKEY_ENABLED') === '1') { @@ -24,7 +24,7 @@ static function (ContainerInterface $container, array $previous): array { return $previous; }, 'paypal-pos.settings.fields.registry' => - static function (ContainerInterface $container, array $previous): array { + static function (array $previous, ContainerInterface $container): array { return array_merge( $previous, [ diff --git a/modules.local/paypal-pos-auth/module.php b/modules.local/paypal-pos-auth/module.php index 6725033..59fbf79 100644 --- a/modules.local/paypal-pos-auth/module.php +++ b/modules.local/paypal-pos-auth/module.php @@ -4,8 +4,6 @@ namespace Syde\PayPal\PointOfSale\Auth; -use Dhii\Modular\Module\ModuleInterface; - -return static function (): ModuleInterface { +return static function (): AuthModule { return new AuthModule(); }; diff --git a/modules.local/paypal-pos-auth/src/AuthModule.php b/modules.local/paypal-pos-auth/src/AuthModule.php index 3dabed2..98cc79d 100644 --- a/modules.local/paypal-pos-auth/src/AuthModule.php +++ b/modules.local/paypal-pos-auth/src/AuthModule.php @@ -4,27 +4,34 @@ namespace Syde\PayPal\PointOfSale\Auth; -use Dhii\Container\ServiceProvider; -use Dhii\Modular\Module\ModuleInterface; +use Inpsyde\Modularity\Module\ExecutableModule; +use Inpsyde\Modularity\Module\ExtendingModule; +use Inpsyde\Modularity\Module\ModuleClassNameIdTrait; +use Inpsyde\Modularity\Module\ServiceModule; use Syde\PayPal\PointOfSale\Auth\OAuth\Token\TokenInterface; use Syde\PayPal\PointOfSale\Auth\OAuth\TokenPersistorInterface; use Syde\PayPal\PointOfSale\Auth\OAuth\TokenProviderInterface; use Syde\PayPal\PointOfSale\Auth\Rest\V1\EndpointInterface; -use Interop\Container\ServiceProviderInterface; use Psr\Container\ContainerInterface; -class AuthModule implements ModuleInterface +class AuthModule implements ServiceModule, ExtendingModule, ExecutableModule { + use ModuleClassNameIdTrait; /** * @inheritDoc */ - public function setup(): ServiceProviderInterface + public function services(): array { - return new ServiceProvider( - require __DIR__ . '/../services.php', - require __DIR__ . '/../extensions.php' - ); + return require __DIR__ . '/../services.php'; + } + + /** + * @inheritDoc + */ + public function extensions(): array + { + return require __DIR__ . '/../extensions.php'; } /** @@ -32,7 +39,7 @@ public function setup(): ServiceProviderInterface * phpcs:disable Generic.Metrics.NestingLevel.TooHigh * phpcs:disable Inpsyde.CodeQuality.FunctionLength.TooLong */ - public function run(ContainerInterface $container): void + public function run(ContainerInterface $container): bool { /** * @var TokenProviderInterface|TokenPersistorInterface $tokenStorage @@ -110,5 +117,7 @@ static function () use ($container) { ); } ); + + return true; } } diff --git a/modules.local/paypal-pos-auth/src/CredentialsContainer.php b/modules.local/paypal-pos-auth/src/CredentialsContainer.php index 026c798..1328e92 100644 --- a/modules.local/paypal-pos-auth/src/CredentialsContainer.php +++ b/modules.local/paypal-pos-auth/src/CredentialsContainer.php @@ -57,7 +57,7 @@ public function __construct( * * @throws Exception */ - public function get($id) + public function get(string $id) { if (array_key_exists($id, $this->data)) { return $this->data[$id]; @@ -85,7 +85,7 @@ public function get($id) * * @return bool */ - public function has($id) + public function has(string $id): bool { if (array_key_exists($id, $this->data)) { return true; diff --git a/modules.local/paypal-pos-auth/src/OAuth/ContainerTokenStorage.php b/modules.local/paypal-pos-auth/src/OAuth/ContainerTokenStorage.php index f231385..b26cc74 100644 --- a/modules.local/paypal-pos-auth/src/OAuth/ContainerTokenStorage.php +++ b/modules.local/paypal-pos-auth/src/OAuth/ContainerTokenStorage.php @@ -4,8 +4,8 @@ namespace Syde\PayPal\PointOfSale\Auth\OAuth; -use Dhii\Collection\MutableContainerInterface; use Syde\PayPal\PointOfSale\Auth\Exception\InvalidTokenException; +use Syde\PayPal\PointOfSale\Container\WritableContainerInterface; use Syde\PayPal\PointOfSale\Auth\OAuth\Token\TokenFactoryInterface; use Syde\PayPal\PointOfSale\Auth\OAuth\Token\TokenInterface; @@ -17,7 +17,7 @@ class ContainerTokenStorage implements TokenPersistorInterface, TokenProviderInt { /** - * @var MutableContainerInterface + * @var WritableContainerInterface */ private $container; @@ -34,12 +34,12 @@ class ContainerTokenStorage implements TokenPersistorInterface, TokenProviderInt /** * SiteOptionTokenStorage constructor. * - * @param MutableContainerInterface $container + * @param WritableContainerInterface $container * @param string $key * @param TokenFactoryInterface $tokenFactory */ public function __construct( - MutableContainerInterface $container, + WritableContainerInterface $container, string $key, TokenFactoryInterface $tokenFactory ) { diff --git a/modules.local/paypal-pos-auth/src/OAuth/TokenDataContainer.php b/modules.local/paypal-pos-auth/src/OAuth/TokenDataContainer.php index e0ebd52..f71533a 100644 --- a/modules.local/paypal-pos-auth/src/OAuth/TokenDataContainer.php +++ b/modules.local/paypal-pos-auth/src/OAuth/TokenDataContainer.php @@ -48,7 +48,7 @@ public function __construct(TokenInterface $token) * phpcs:disable Inpsyde.CodeQuality.ReturnTypeDeclaration.NoReturnType * phpcs:disable Inpsyde.CodeQuality.ArgumentTypeDeclaration.NoArgumentType */ - public function get($key) + public function get(string $key) { if (!$this->has($key)) { throw new InvalidTokenPropertyException("Property '{$key}' not found on Token"); @@ -62,7 +62,7 @@ public function get($key) * phpcs:disable Inpsyde.CodeQuality.ReturnTypeDeclaration.NoReturnType * phpcs:disable Inpsyde.CodeQuality.ArgumentTypeDeclaration.NoArgumentType */ - public function has($key) + public function has(string $key): bool { return array_key_exists($key, $this->accessors); } diff --git a/modules.local/paypal-pos-logging/composer.json b/modules.local/paypal-pos-logging/composer.json index fd3ee95..d89b0a3 100644 --- a/modules.local/paypal-pos-logging/composer.json +++ b/modules.local/paypal-pos-logging/composer.json @@ -4,7 +4,7 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "dhii/module-interface": "^0.2 || ^0.3", + "inpsyde/modularity": "^1.7", "psr/log": "^1.1", "ext-json": "*" }, diff --git a/modules.local/paypal-pos-logging/module.php b/modules.local/paypal-pos-logging/module.php index 82d4944..09283ea 100644 --- a/modules.local/paypal-pos-logging/module.php +++ b/modules.local/paypal-pos-logging/module.php @@ -4,8 +4,6 @@ namespace Syde\PayPal\PointOfSale\Logging; -use Dhii\Modular\Module\ModuleInterface; - -return static function (): ModuleInterface { +return static function (): ZettleLoggingModule { return new ZettleLoggingModule(); }; diff --git a/modules.local/paypal-pos-logging/src/ZettleLoggingModule.php b/modules.local/paypal-pos-logging/src/ZettleLoggingModule.php index 424d312..dec330c 100644 --- a/modules.local/paypal-pos-logging/src/ZettleLoggingModule.php +++ b/modules.local/paypal-pos-logging/src/ZettleLoggingModule.php @@ -4,29 +4,18 @@ namespace Syde\PayPal\PointOfSale\Logging; -use Dhii\Container\ServiceProvider; -use Dhii\Modular\Module\ModuleInterface; -use Interop\Container\ServiceProviderInterface; -use Psr\Container\ContainerInterface; +use Inpsyde\Modularity\Module\ModuleClassNameIdTrait; +use Inpsyde\Modularity\Module\ServiceModule; -class ZettleLoggingModule implements ModuleInterface +class ZettleLoggingModule implements ServiceModule { + use ModuleClassNameIdTrait; /** * @inheritDoc */ - public function setup(): ServiceProviderInterface - { - return new ServiceProvider( - require __DIR__ . '/../services.php', - require __DIR__ . '/../extensions.php' - ); - } - - /** - * @inheritDoc - */ - public function run(ContainerInterface $container): void + public function services(): array { + return require __DIR__ . '/../services.php'; } } diff --git a/modules.local/paypal-pos-notices/composer.json b/modules.local/paypal-pos-notices/composer.json index ab92746..e9f40ab 100644 --- a/modules.local/paypal-pos-notices/composer.json +++ b/modules.local/paypal-pos-notices/composer.json @@ -2,7 +2,7 @@ "name": "inpsyde/paypal-pos-notices", "type": "inpsyde-module", "require": { - "dhii/module-interface": "^0.2 || ^0.3" + "inpsyde/modularity": "^1.7" }, "autoload": { "psr-4": { diff --git a/modules.local/paypal-pos-notices/module.php b/modules.local/paypal-pos-notices/module.php index d17bfa8..a61025c 100644 --- a/modules.local/paypal-pos-notices/module.php +++ b/modules.local/paypal-pos-notices/module.php @@ -4,8 +4,6 @@ namespace Syde\PayPal\PointOfSale\Notices; -use Dhii\Modular\Module\ModuleInterface; - -return static function (): ModuleInterface { +return static function (): NoticesModule { return new NoticesModule(); }; diff --git a/modules.local/paypal-pos-notices/src/NoticesModule.php b/modules.local/paypal-pos-notices/src/NoticesModule.php index 7bb801c..75c72e0 100644 --- a/modules.local/paypal-pos-notices/src/NoticesModule.php +++ b/modules.local/paypal-pos-notices/src/NoticesModule.php @@ -4,34 +4,32 @@ namespace Syde\PayPal\PointOfSale\Notices; -use Dhii\Container\ServiceProvider; -use Dhii\Modular\Module\ModuleInterface; +use Inpsyde\Modularity\Module\ExecutableModule; +use Inpsyde\Modularity\Module\ModuleClassNameIdTrait; +use Inpsyde\Modularity\Module\ServiceModule; use Inpsyde\StateMachine\StateMachineInterface; use Syde\PayPal\PointOfSale\Notices\Notice\NoticeDelegator; -use Interop\Container\ServiceProviderInterface; use Psr\Container\ContainerInterface as C; -class NoticesModule implements ModuleInterface +class NoticesModule implements ServiceModule, ExecutableModule { + use ModuleClassNameIdTrait; /** * @inheritDoc */ - public function setup(): ServiceProviderInterface + public function services(): array { - return new ServiceProvider( - require __DIR__ . '/../services.php', - require __DIR__ . '/../extensions.php' - ); + return require __DIR__ . '/../services.php'; } /** * @inheritDoc */ - public function run(C $container): void + public function run(C $container): bool { if (!is_admin()) { - return; + return true; } $noticeDelegator = $container->get('paypal-pos.notices.notification.delegator'); @@ -43,5 +41,7 @@ public function run(C $container): void $noticeDelegator->delegate( $stateMachine->currentState()->name() ); + + return true; } } diff --git a/modules.local/paypal-pos-onboarding/composer.json b/modules.local/paypal-pos-onboarding/composer.json index c5b66a5..f59fe96 100644 --- a/modules.local/paypal-pos-onboarding/composer.json +++ b/modules.local/paypal-pos-onboarding/composer.json @@ -22,7 +22,7 @@ } ], "require": { - "dhii/module-interface": "^0.2 || ^0.3", + "inpsyde/modularity": "^1.7", "inpsyde/inpsyde-state-machine": "*", "inpsyde/paypal-pos-auth": "*", "inpsyde/paypal-pos-php-sdk": "*", diff --git a/modules.local/paypal-pos-onboarding/extensions.php b/modules.local/paypal-pos-onboarding/extensions.php index d0526a4..46ea0f7 100644 --- a/modules.local/paypal-pos-onboarding/extensions.php +++ b/modules.local/paypal-pos-onboarding/extensions.php @@ -17,7 +17,7 @@ use Psr\Container\ContainerInterface as C; return [ - 'paypal-pos.init-possible' => static function (C $ctr, bool $previous): bool { + 'paypal-pos.init-possible' => static function (bool $previous, C $ctr): bool { $initableStates = [ OnboardingState::SYNC_PARAM_PRODUCTS, OnboardingState::SYNC_PARAM_VAT, @@ -31,8 +31,8 @@ return in_array($stateMachine->currentState()->name(), $initableStates, true); }, 'paypal-pos.sdk.dal.provider.organization' => static function ( - C $container, - OrganizationProvider $previous + OrganizationProvider $previous, + C $container ): OrganizationProvider { $preSyncStates = $container->get('paypal-pos.onboarding.settings-states'); @@ -45,10 +45,10 @@ return $previous; }, - 'inpsyde.state-machine.namespace' => static function (C $container, string $previous): string { + 'inpsyde.state-machine.namespace' => static function (string $previous, C $container): string { return 'paypal-pos.onboarding'; }, - 'paypal-pos.settings.fields' => static function (C $container, array $previous): array { + 'paypal-pos.settings.fields' => static function (array $previous, C $container): array { $filter = $container->get('paypal-pos.onboarding.settings.filter'); return [ @@ -64,7 +64,7 @@ ], ] + $filter->filter($previous); }, - 'paypal-pos.settings.field-renderers' => static function (C $container, array $previous): array { + 'paypal-pos.settings.field-renderers' => static function (array $previous, C $container): array { $previous[] = $container->get('paypal-pos.onboarding.settings.renderer.removed'); $previous[] = $container->get('paypal-pos.onboarding.settings.renderer.hidden'); $previous[] = $container->get('paypal-pos.onboarding.settings.renderer.password'); @@ -73,7 +73,7 @@ return $previous; }, 'inpsyde.queue.rest.v1.endpoint.meta-callback' => - static function (C $container, callable $previous): callable { + static function (callable $previous, C $container): callable { return static function (array $meta, array $types = []) use ($container, $previous): array { $previous = $previous(); @@ -104,8 +104,8 @@ static function (C $container, callable $previous): callable { }; }, 'inpsyde.state-machine.events.listener-provider.state-aware' => static function ( - C $container, - StateAwareListenerProvider $listenerProvider + StateAwareListenerProvider $listenerProvider, + C $container ): StateAwareListenerProvider { foreach ( $container->get( @@ -120,8 +120,8 @@ static function (C $container, callable $previous): callable { return $listenerProvider; }, 'inpsyde.state-machine.events.listener-provider.transition-aware' => static function ( - C $container, - TransitionAwareListenerProvider $listenerProvider + TransitionAwareListenerProvider $listenerProvider, + C $container ): TransitionAwareListenerProvider { foreach ( $container->get( @@ -136,8 +136,8 @@ static function (C $container, callable $previous): callable { return $listenerProvider; }, 'inpsyde.state-machine.events.listener-provider.internal' => static function ( - C $container, - ListenerProvider $listenerProvider + ListenerProvider $listenerProvider, + C $container ): ListenerProvider { $setState = $container->get('paypal-pos.onboarding.set-state'); assert(is_callable($setState)); @@ -166,7 +166,7 @@ static function (PostTransition $event) use ($setState) { * We don't want the queue to process anything if onboarding has not yet completed. * In that case, we simply pass an empty array as the available queue runners */ - 'inpsyde.queue.runners' => static function (C $container, array $previous): array { + 'inpsyde.queue.runners' => static function (array $previous, C $container): array { $currentState = $container->get('inpsyde.state-machine')->currentState()->name(); if ($currentState === OnboardingState::ONBOARDING_COMPLETED) { @@ -176,13 +176,13 @@ static function (PostTransition $event) use ($setState) { return []; }, 'paypal-pos.assets.should-enqueue.all' => - static function (C $container, callable $previous): callable { + static function (callable $previous, C $container): callable { return static function () use ($previous, $container): bool { return $previous() and $container->get('paypal-pos.settings.is-integration-page')(); }; }, 'paypal-pos.assets.should-enqueue.sync-module' => - static function (C $container, callable $previous): callable { + static function (callable $previous, C $container): callable { return static function () use ($previous, $container): bool { if (!$previous()) { return false; @@ -194,7 +194,7 @@ static function (C $container, callable $previous): callable { }; }, 'inpsyde.wc-lifecycle-events.products.toggle' => - static function (C $container, Toggle $toggle): Toggle { + static function (Toggle $toggle, C $container): Toggle { $currentState = $container->get('inpsyde.state-machine')->currentState()->name(); if ($currentState === OnboardingState::ONBOARDING_COMPLETED) { diff --git a/modules.local/paypal-pos-onboarding/src/Job/ResetOnboardingJob.php b/modules.local/paypal-pos-onboarding/src/Job/ResetOnboardingJob.php index 1f6a01e..9e68e10 100644 --- a/modules.local/paypal-pos-onboarding/src/Job/ResetOnboardingJob.php +++ b/modules.local/paypal-pos-onboarding/src/Job/ResetOnboardingJob.php @@ -4,8 +4,8 @@ namespace Syde\PayPal\PointOfSale\Onboarding\Job; -use Dhii\Collection\ClearableContainerInterface; use Exception; +use Syde\PayPal\PointOfSale\Container\ClearableContainerInterface; use Inpsyde\Queue\Queue\Job\ContextInterface; use Inpsyde\Queue\Queue\Job\Job; use Inpsyde\Queue\Queue\Job\JobRepository; diff --git a/modules.local/paypal-pos-onboarding/src/OnboardingModule.php b/modules.local/paypal-pos-onboarding/src/OnboardingModule.php index 86ade80..a998c54 100644 --- a/modules.local/paypal-pos-onboarding/src/OnboardingModule.php +++ b/modules.local/paypal-pos-onboarding/src/OnboardingModule.php @@ -4,42 +4,37 @@ namespace Syde\PayPal\PointOfSale\Onboarding; -use Dhii\Container\ServiceProvider; -use Dhii\Modular\Module\ModuleInterface; -use Syde\PayPal\PointOfSale\BootableProviderAwareTrait; -use Syde\PayPal\PointOfSale\BootableProviderModuleInterface; -use Interop\Container\ServiceProviderInterface; +use Inpsyde\Modularity\Module\ExecutableModule; +use Inpsyde\Modularity\Module\ExtendingModule; +use Inpsyde\Modularity\Module\ModuleClassNameIdTrait; +use Inpsyde\Modularity\Module\ServiceModule; use Psr\Container\ContainerInterface as C; -class OnboardingModule implements ModuleInterface, BootableProviderModuleInterface +class OnboardingModule implements ServiceModule, ExtendingModule, ExecutableModule { - use BootableProviderAwareTrait; + use ModuleClassNameIdTrait; - /** - * @inheritDoc - */ - public function setup(): ServiceProviderInterface + public function services(): array { - return new ServiceProvider( - array_merge( - require __DIR__ . '/../services.php', - require __DIR__ . '/../state-machine.php' - ), - require __DIR__ . '/../extensions.php' + return array_merge( + require __DIR__ . '/../services.php', + require __DIR__ . '/../state-machine.php' ); } + public function extensions(): array + { + return require __DIR__ . '/../extensions.php'; + } + /** - * @inheritDoc - * * phpcs:disable Generic.Metrics.NestingLevel.TooHigh */ - public function run(C $container): void + public function run(C $container): bool { - $this->bootProviders( - $container, - ...$container->get('paypal-pos.onboarding.provider') - ); + foreach ($container->get('paypal-pos.onboarding.provider') as $provider) { + $provider->boot($container); + } add_filter( 'woocommerce_settings_api_sanitized_fields_' . $container->get('paypal-pos.settings.wc-integration.id'), @@ -63,5 +58,7 @@ static function () use ($container) { ); } ); + + return true; } } diff --git a/modules.local/paypal-pos-onboarding/state-machine.php b/modules.local/paypal-pos-onboarding/state-machine.php index 9b536e7..de7f260 100644 --- a/modules.local/paypal-pos-onboarding/state-machine.php +++ b/modules.local/paypal-pos-onboarding/state-machine.php @@ -3,7 +3,6 @@ namespace Syde\PayPal\PointOfSale\Onboarding; -use Dhii\Data\Container\WritableContainerInterface; use Inpsyde\Queue\Queue\Job\Context; use Inpsyde\Queue\Queue\Job\EphemeralJobRepository; use Inpsyde\Queue\Queue\Job\Job; diff --git a/modules.local/paypal-pos-php-sdk/composer.json b/modules.local/paypal-pos-php-sdk/composer.json index 053cb50..2f4561f 100644 --- a/modules.local/paypal-pos-php-sdk/composer.json +++ b/modules.local/paypal-pos-php-sdk/composer.json @@ -10,8 +10,7 @@ } ], "require": { - "dhii/module-interface": "^0.2 || ^0.3", - "dhii/containers": "^0.1", + "inpsyde/modularity": "^1.7", "werkspot/enum": "^2.1", "psr/log": "^1.1", "inpsyde/wc-product-contracts": "*", diff --git a/modules.local/paypal-pos-php-sdk/extensions.php b/modules.local/paypal-pos-php-sdk/extensions.php index 2bb5a6b..8765d86 100644 --- a/modules.local/paypal-pos-php-sdk/extensions.php +++ b/modules.local/paypal-pos-php-sdk/extensions.php @@ -7,7 +7,7 @@ use Psr\Container\ContainerInterface as C; return [ - 'inpsyde.debug.exception-formatters' => static function (C $ctr, array $previous): array { + 'inpsyde.debug.exception-formatters' => static function (array $previous, C $ctr): array { $previous[ZettleRestException::class] = new class implements ExceptionFormatter { public function format(Throwable $exception): string diff --git a/modules.local/paypal-pos-php-sdk/services.php b/modules.local/paypal-pos-php-sdk/services.php index b448304..d2e7c78 100644 --- a/modules.local/paypal-pos-php-sdk/services.php +++ b/modules.local/paypal-pos-php-sdk/services.php @@ -4,8 +4,8 @@ namespace Syde\PayPal\PointOfSale\PhpSdk; -use Dhii\Collection\MutableContainerInterface; use Http\Message\UriFactory; +use Syde\PayPal\PointOfSale\Container\WritableContainerInterface; use Syde\PayPal\PointOfSale\PhpSdk\API\Image\Images; use Syde\PayPal\PointOfSale\PhpSdk\API\Inventory\Inventory; use Syde\PayPal\PointOfSale\PhpSdk\API\Inventory\Locations; @@ -103,7 +103,7 @@ return (string) Uuid::v1(); } $idContainer = $container->get('paypal-pos.sdk.integration-id.container'); - assert($idContainer instanceof MutableContainerInterface); + assert($idContainer instanceof WritableContainerInterface); $key = $container->get('paypal-pos.sdk.option.integration'); if (!$idContainer->has($key)) { diff --git a/modules.local/paypal-pos-php-sdk/src/Config/WooCommerceConfigContainer.php b/modules.local/paypal-pos-php-sdk/src/Config/WooCommerceConfigContainer.php index 74d7f6b..d96f3fd 100644 --- a/modules.local/paypal-pos-php-sdk/src/Config/WooCommerceConfigContainer.php +++ b/modules.local/paypal-pos-php-sdk/src/Config/WooCommerceConfigContainer.php @@ -19,7 +19,7 @@ class WooCommerceConfigContainer implements ContainerInterface * * @throws RuntimeException */ - public function get($id) + public function get(string $id) { if (!$this->has($id)) { throw new class ( @@ -37,7 +37,7 @@ public function get($id) * * @return bool */ - public function has($id): bool + public function has(string $id): bool { return !!get_option($this->key($id)); } diff --git a/modules.local/paypal-pos-php-sdk/src/NamespacedContainer.php b/modules.local/paypal-pos-php-sdk/src/NamespacedContainer.php index e0b05cc..8b4cf15 100644 --- a/modules.local/paypal-pos-php-sdk/src/NamespacedContainer.php +++ b/modules.local/paypal-pos-php-sdk/src/NamespacedContainer.php @@ -35,7 +35,7 @@ public function __construct(string $namespace, ContainerInterface $base) /** * @inheritDoc */ - public function get($id) + public function get(string $id) { return $this->base->get("{$this->namespace}.$id"); } @@ -43,7 +43,7 @@ public function get($id) /** * @inheritDoc */ - public function has($id) + public function has(string $id): bool { return $this->base->has("{$this->namespace}.$id"); } diff --git a/modules.local/paypal-pos-php-sdk/src/PhpSdkModule.php b/modules.local/paypal-pos-php-sdk/src/PhpSdkModule.php index 4c103d9..f4c1f3d 100644 --- a/modules.local/paypal-pos-php-sdk/src/PhpSdkModule.php +++ b/modules.local/paypal-pos-php-sdk/src/PhpSdkModule.php @@ -4,33 +4,32 @@ namespace Syde\PayPal\PointOfSale\PhpSdk; -use Dhii\Container\ServiceProvider; -use Dhii\Modular\Module\ModuleInterface; -use Syde\PayPal\PointOfSale\BootableProviderAwareTrait; -use Syde\PayPal\PointOfSale\BootableProviderModuleInterface; -use Interop\Container\ServiceProviderInterface; +use Inpsyde\Modularity\Module\ExecutableModule; +use Inpsyde\Modularity\Module\ExtendingModule; +use Inpsyde\Modularity\Module\ModuleClassNameIdTrait; +use Inpsyde\Modularity\Module\ServiceModule; use Psr\Container\ContainerInterface; -class PhpSdkModule implements ModuleInterface, BootableProviderModuleInterface +class PhpSdkModule implements ServiceModule, ExtendingModule, ExecutableModule { - use BootableProviderAwareTrait; + use ModuleClassNameIdTrait; - /** - * @inheritDoc - */ - public function setup(): ServiceProviderInterface + public function services(): array { - return new ServiceProvider( - require __DIR__ . '/../services.php', - require __DIR__ . '/../extensions.php' - ); + return require __DIR__ . '/../services.php'; } - /** - * @inheritDoc - */ - public function run(ContainerInterface $container): void + public function extensions(): array { - $this->bootProviders($container, ...$container->get('paypal-pos.sdk.provider')); + return require __DIR__ . '/../extensions.php'; + } + + public function run(ContainerInterface $container): bool + { + foreach ($container->get('paypal-pos.sdk.provider') as $provider) { + $provider->boot($container); + } + + return true; } } diff --git a/modules.local/paypal-pos-php-sdk/src/ZettlePhpSdkLibrary.php b/modules.local/paypal-pos-php-sdk/src/ZettlePhpSdkLibrary.php index bbac983..d0bab93 100644 --- a/modules.local/paypal-pos-php-sdk/src/ZettlePhpSdkLibrary.php +++ b/modules.local/paypal-pos-php-sdk/src/ZettlePhpSdkLibrary.php @@ -4,10 +4,11 @@ namespace Syde\PayPal\PointOfSale\PhpSdk; -use Dhii\Container\CompositeCachingServiceProvider; -use Dhii\Container\DelegatingContainer; -use Dhii\Container\ServiceProvider; -use Dhii\Modular\Module\Exception\ModuleExceptionInterface; +use Inpsyde\Modularity\Module\ExtendingModule; +use Inpsyde\Modularity\Module\ModuleClassNameIdTrait; +use Inpsyde\Modularity\Module\ServiceModule; +use Inpsyde\Modularity\Package; +use Inpsyde\Modularity\Properties\LibraryProperties; use Psr\Container\ContainerInterface; /** @@ -16,15 +17,10 @@ class ZettlePhpSdkLibrary { /** - * @var DelegatingContainer + * @var ContainerInterface */ private $container; - /** - * @var CompositeCachingServiceProvider - */ - private $provider; - /** * @var PhpSdkModule */ @@ -33,15 +29,47 @@ class ZettlePhpSdkLibrary public function __construct(array $factories = [], array $extensions = []) { $this->module = new PhpSdkModule(); - $providers = [$this->module->setup()]; - $providers[] = new ServiceProvider($factories, $extensions); - $this->provider = new CompositeCachingServiceProvider($providers); - $this->container = new DelegatingContainer($this->provider); + $package = Package::new(LibraryProperties::new(__DIR__ . '/../composer.json')); + $package->addModule($this->module); + + if ($factories !== [] || $extensions !== []) { + $package->addModule( + new class ($factories, $extensions) implements ServiceModule, ExtendingModule { + use ModuleClassNameIdTrait; + + /** + * @var array + */ + private $factories; + + /** + * @var array + */ + private $extensions; + + public function __construct(array $factories, array $extensions) + { + $this->factories = $factories; + $this->extensions = $extensions; + } + + public function services(): array + { + return $this->factories; + } + + public function extensions(): array + { + return $this->extensions; + } + } + ); + } + + $package->build(); + $this->container = $package->container(); } - /** - * @throws ModuleExceptionInterface - */ public function initialize() { $this->module->run($this->container()); diff --git a/modules.local/paypal-pos-php-sdk/tests/PHPUnit/Helper/Stub/ArrayContainer.php b/modules.local/paypal-pos-php-sdk/tests/PHPUnit/Helper/Stub/ArrayContainer.php index 5c6f2b2..3ed3b98 100644 --- a/modules.local/paypal-pos-php-sdk/tests/PHPUnit/Helper/Stub/ArrayContainer.php +++ b/modules.local/paypal-pos-php-sdk/tests/PHPUnit/Helper/Stub/ArrayContainer.php @@ -4,13 +4,11 @@ namespace Syde\PayPal\PointOfSale\PhpSdk\Tests\Stub; -use Dhii\Collection\ClearableContainerInterface; -use Dhii\Collection\MutableContainerInterface; use Exception; use Psr\Container\ContainerInterface; use Psr\Container\NotFoundExceptionInterface; -class ArrayContainer implements ContainerInterface, MutableContainerInterface, ClearableContainerInterface +class ArrayContainer implements ContainerInterface { /** * @var array @@ -25,7 +23,7 @@ public function __construct(array $options) /** * @inheritDoc */ - public function get($id) + public function get(string $id) { if (!$this->has($id)) { $exceptionMessage = sprintf( @@ -42,14 +40,11 @@ public function get($id) /** * @inheritDoc */ - public function has($id) + public function has(string $id): bool { return array_key_exists($id, $this->options); } - /** - * @inheritDoc - */ public function set($key, $value): void { $this->options[$key] = $value; diff --git a/modules.local/paypal-pos-php-sdk/tests/PHPUnit/bootstrap.php b/modules.local/paypal-pos-php-sdk/tests/PHPUnit/bootstrap.php index 70b2b3f..febe543 100644 --- a/modules.local/paypal-pos-php-sdk/tests/PHPUnit/bootstrap.php +++ b/modules.local/paypal-pos-php-sdk/tests/PHPUnit/bootstrap.php @@ -11,8 +11,6 @@ require_once $vendor.'brain/monkey/inc/patchwork-loader.php'; require_once $vendor.'autoload.php'; -require_once $root . '/../../src/BootableProviderModuleInterface.php'; -require_once $root . '/../../src/BootableProviderAwareTrait.php'; require_once $root . '/../../packages.local/wc-product-contracts/src/ProductType.php'; require_once $root . '/../../packages.local/wc-product-contracts/src/ProductState.php'; diff --git a/modules.local/paypal-pos-product-debug/composer.json b/modules.local/paypal-pos-product-debug/composer.json index 5a5999e..c117fa3 100644 --- a/modules.local/paypal-pos-product-debug/composer.json +++ b/modules.local/paypal-pos-product-debug/composer.json @@ -2,7 +2,7 @@ "name": "inpsyde/paypal-pos-product-debug", "type": "inpsyde-module", "require": { - "dhii/module-interface": "^0.2 || ^0.3" + "inpsyde/modularity": "^1.7" }, "autoload": { "psr-4": { diff --git a/modules.local/paypal-pos-product-debug/extensions.php b/modules.local/paypal-pos-product-debug/extensions.php index 9a5cd4c..21bf50e 100644 --- a/modules.local/paypal-pos-product-debug/extensions.php +++ b/modules.local/paypal-pos-product-debug/extensions.php @@ -11,7 +11,7 @@ use Psr\Container\ContainerInterface as C; return [ - 'inpsyde.assets.registry' => static function (C $container, array $previous): array { + 'inpsyde.assets.registry' => static function (array $previous, C $container): array { // see https://bugs.php.net/bug.php?id=49184 // phpcs:ignore WordPress.Security, using only to compare value, not storing anywhere. $scriptFileName = $_SERVER['SCRIPT_FILENAME'] ?? ''; diff --git a/modules.local/paypal-pos-product-debug/module.php b/modules.local/paypal-pos-product-debug/module.php index 9bf012a..57794f8 100644 --- a/modules.local/paypal-pos-product-debug/module.php +++ b/modules.local/paypal-pos-product-debug/module.php @@ -4,8 +4,6 @@ namespace Syde\PayPal\PointOfSale\ProductDebug; -use Dhii\Modular\Module\ModuleInterface; - -return static function (): ModuleInterface { +return static function (): ProductDebugModule { return new ProductDebugModule(); }; diff --git a/modules.local/paypal-pos-product-debug/src/ProductDebugModule.php b/modules.local/paypal-pos-product-debug/src/ProductDebugModule.php index 0c8332c..0aee95b 100644 --- a/modules.local/paypal-pos-product-debug/src/ProductDebugModule.php +++ b/modules.local/paypal-pos-product-debug/src/ProductDebugModule.php @@ -4,33 +4,32 @@ namespace Syde\PayPal\PointOfSale\ProductDebug; -use Dhii\Container\ServiceProvider; -use Dhii\Modular\Module\ModuleInterface; use Exception; -use Interop\Container\ServiceProviderInterface; +use Inpsyde\Modularity\Module\ExecutableModule; +use Inpsyde\Modularity\Module\ExtendingModule; +use Inpsyde\Modularity\Module\ModuleClassNameIdTrait; +use Inpsyde\Modularity\Module\ServiceModule; use Psr\Container\ContainerInterface as C; use WP_CLI; -class ProductDebugModule implements ModuleInterface +class ProductDebugModule implements ServiceModule, ExtendingModule, ExecutableModule { + use ModuleClassNameIdTrait; - /** - * @inheritDoc - */ - public function setup(): ServiceProviderInterface + public function services(): array { - return new ServiceProvider( - require __DIR__ . '/../services.php', - require __DIR__ . '/../extensions.php' - ); + return require __DIR__ . '/../services.php'; + } + + public function extensions(): array + { + return require __DIR__ . '/../extensions.php'; } /** - * @inheritDoc - * * phpcs:disable Inpsyde.CodeQuality.FunctionLength.TooLong */ - public function run(C $container): void + public function run(C $container): bool { add_action( 'rest_api_init', @@ -89,5 +88,7 @@ static function ($columnName) use ($customColumn) { } catch (Exception $exception) { } } + + return true; } } diff --git a/modules.local/paypal-pos-product-settings/composer.json b/modules.local/paypal-pos-product-settings/composer.json index 7889171..3413bd3 100644 --- a/modules.local/paypal-pos-product-settings/composer.json +++ b/modules.local/paypal-pos-product-settings/composer.json @@ -10,7 +10,7 @@ } ], "require": { - "dhii/module-interface": "^0.2 || ^0.3", + "inpsyde/modularity": "^1.7", "inpsyde/wc-product-contracts": "*" }, "autoload": { diff --git a/modules.local/paypal-pos-product-settings/extensions.php b/modules.local/paypal-pos-product-settings/extensions.php index c4cc9ba..8034d74 100644 --- a/modules.local/paypal-pos-product-settings/extensions.php +++ b/modules.local/paypal-pos-product-settings/extensions.php @@ -13,7 +13,7 @@ return [ 'paypal-pos.sync.product.sync-active-for-id' => - static function (C $container, callable $previous): callable { + static function (callable $previous, C $container): callable { return static function (int $productId) use ($container, $previous): bool { if (!$previous($productId)) { return false; @@ -34,7 +34,7 @@ static function (C $container, callable $previous): callable { }; }, 'inpsyde.assets.registry' => - static function (C $container, array $previous): array { + static function (array $previous, C $container): array { $assetUri = rtrim(plugins_url('/assets/', __DIR__ . '/paypal-point-of-sale.php'), '/\\'); $isProductsEditor = $container->get('paypal-pos.product-settings.is-product-editor'); @@ -69,7 +69,7 @@ static function (C $container, array $previous): array { $previous ); }, - 'inpsyde.metabox.registry' => static function (C $container, array $previous): array { + 'inpsyde.metabox.registry' => static function (array $previous, C $container): array { $previous[] = $container->get( 'paypal-pos.product-settings.metabox.product.library.link' ); diff --git a/modules.local/paypal-pos-product-settings/module.php b/modules.local/paypal-pos-product-settings/module.php index 15a74f1..48b1713 100644 --- a/modules.local/paypal-pos-product-settings/module.php +++ b/modules.local/paypal-pos-product-settings/module.php @@ -4,8 +4,6 @@ namespace Syde\PayPal\PointOfSale\ProductSettings; -use Dhii\Modular\Module\ModuleInterface; - -return static function (): ModuleInterface { +return static function (): ProductSettingsModule { return new ProductSettingsModule(); }; diff --git a/modules.local/paypal-pos-product-settings/src/ProductSettingsModule.php b/modules.local/paypal-pos-product-settings/src/ProductSettingsModule.php index 3ab1970..ff92e07 100644 --- a/modules.local/paypal-pos-product-settings/src/ProductSettingsModule.php +++ b/modules.local/paypal-pos-product-settings/src/ProductSettingsModule.php @@ -4,44 +4,38 @@ namespace Syde\PayPal\PointOfSale\ProductSettings; -use Dhii\Container\ServiceProvider; -use Dhii\Modular\Module\ModuleInterface; -use Syde\PayPal\PointOfSale\BootableProviderAwareTrait; -use Syde\PayPal\PointOfSale\BootableProviderModuleInterface; +use Inpsyde\Modularity\Module\ExecutableModule; +use Inpsyde\Modularity\Module\ExtendingModule; +use Inpsyde\Modularity\Module\ModuleClassNameIdTrait; +use Inpsyde\Modularity\Module\ServiceModule; use Syde\PayPal\PointOfSale\PhpSdk\Repository\WooCommerce\Product\ProductRepositoryInterface; use Syde\PayPal\PointOfSale\ProductSettings\Barcode\BarcodeInputField; use Syde\PayPal\PointOfSale\ProductSettings\Barcode\VariantBarcodeSaveHandler; -use Interop\Container\ServiceProviderInterface; use Psr\Container\ContainerInterface as C; use WP_Post; -class ProductSettingsModule implements ModuleInterface, BootableProviderModuleInterface +class ProductSettingsModule implements ServiceModule, ExtendingModule, ExecutableModule { - use BootableProviderAwareTrait; + use ModuleClassNameIdTrait; - /** - * @inheritDoc - */ - public function setup(): ServiceProviderInterface + public function services(): array { - return new ServiceProvider( - require __DIR__ . '/../services.php', - require __DIR__ . '/../extensions.php' - ); + return require __DIR__ . '/../services.php'; } - /** - * @inheritDoc - */ - public function run(C $container): void + public function extensions(): array + { + return require __DIR__ . '/../extensions.php'; + } + + public function run(C $container): bool { // do this a bit later to make the filter adding more flexible // and avoid loading translations too early (WP 6.7) add_action('init', function () use ($container) { - $this->bootProviders( - $container, - ...$container->get('paypal-pos.product-settings.provider') - ); + foreach ($container->get('paypal-pos.product-settings.provider') as $provider) { + $provider->boot($container); + } if ($container->get('paypal-pos.product-settings.barcode.standard-ui-enabled')) { $this->addVariationBarcodeHandlers( @@ -51,6 +45,8 @@ public function run(C $container): void ); } }); + + return true; } private function addVariationBarcodeHandlers( diff --git a/modules.local/paypal-pos-queue/composer.json b/modules.local/paypal-pos-queue/composer.json index 7cec969..e410ae2 100644 --- a/modules.local/paypal-pos-queue/composer.json +++ b/modules.local/paypal-pos-queue/composer.json @@ -2,7 +2,7 @@ "name": "inpsyde/paypal-pos-queue", "type": "inpsyde-module", "require": { - "dhii/module-interface": "^0.2 || ^0.3", + "inpsyde/modularity": "^1.7", "ext-json": "*" }, "autoload": { diff --git a/modules.local/paypal-pos-queue/extensions.php b/modules.local/paypal-pos-queue/extensions.php index a812568..14276c6 100644 --- a/modules.local/paypal-pos-queue/extensions.php +++ b/modules.local/paypal-pos-queue/extensions.php @@ -7,7 +7,7 @@ use Psr\Container\ContainerInterface as C; return [ - 'inpsyde.queue.namespace' => static function (C $container, string $previous): string { + 'inpsyde.queue.namespace' => static function (string $previous, C $container): string { return "zettle"; }, ]; diff --git a/modules.local/paypal-pos-queue/module.php b/modules.local/paypal-pos-queue/module.php index b84b5c8..69886bb 100644 --- a/modules.local/paypal-pos-queue/module.php +++ b/modules.local/paypal-pos-queue/module.php @@ -4,8 +4,6 @@ namespace Syde\PayPal\PointOfSale\Queue; -use Dhii\Modular\Module\ModuleInterface; - -return static function (): ModuleInterface { +return static function (): ZettleQueueModule { return new ZettleQueueModule(); }; diff --git a/modules.local/paypal-pos-queue/src/ZettleQueueModule.php b/modules.local/paypal-pos-queue/src/ZettleQueueModule.php index e29836f..248a071 100644 --- a/modules.local/paypal-pos-queue/src/ZettleQueueModule.php +++ b/modules.local/paypal-pos-queue/src/ZettleQueueModule.php @@ -4,33 +4,31 @@ namespace Syde\PayPal\PointOfSale\Queue; -use Dhii\Container\ServiceProvider; -use Dhii\Modular\Module\ModuleInterface; +use Inpsyde\Modularity\Module\ExecutableModule; +use Inpsyde\Modularity\Module\ExtendingModule; +use Inpsyde\Modularity\Module\ModuleClassNameIdTrait; +use Inpsyde\Modularity\Module\ServiceModule; use Inpsyde\Queue\Bootstrap; -use Interop\Container\ServiceProviderInterface; use Psr\Container\ContainerInterface; -class ZettleQueueModule implements ModuleInterface +class ZettleQueueModule implements ServiceModule, ExtendingModule, ExecutableModule { + use ModuleClassNameIdTrait; - /** - * @inheritDoc - */ - public function setup(): ServiceProviderInterface + public function services(): array { - return new ServiceProvider( - require __DIR__ . '/../services.php', - require __DIR__ . '/../extensions.php' - ); + return require __DIR__ . '/../services.php'; } - /** - * @inheritDoc - */ - public function run(ContainerInterface $container): void + public function extensions(): array + { + return require __DIR__ . '/../extensions.php'; + } + + public function run(ContainerInterface $container): bool { if (!$container->has('inpsyde.queue.bootstrap')) { - return; + return true; } /** @var Bootstrap $bootstrap */ @@ -49,5 +47,7 @@ static function () use ($bootstrap) { }, 5 ); + + return true; } } diff --git a/modules.local/paypal-pos-settings/composer.json b/modules.local/paypal-pos-settings/composer.json index 32c712e..adab680 100644 --- a/modules.local/paypal-pos-settings/composer.json +++ b/modules.local/paypal-pos-settings/composer.json @@ -2,7 +2,7 @@ "name": "inpsyde/paypal-pos-settings", "type": "inpsyde-module", "require": { - "dhii/module-interface": "^0.2 || ^0.3" + "inpsyde/modularity": "^1.7" }, "autoload": { "psr-4": { diff --git a/modules.local/paypal-pos-settings/module.php b/modules.local/paypal-pos-settings/module.php index af125fd..9715757 100644 --- a/modules.local/paypal-pos-settings/module.php +++ b/modules.local/paypal-pos-settings/module.php @@ -4,8 +4,6 @@ namespace Syde\PayPal\PointOfSale\Settings; -use Dhii\Modular\Module\ModuleInterface; - -return static function (): ModuleInterface { +return static function (): SettingsModule { return new SettingsModule(); }; diff --git a/modules.local/paypal-pos-settings/src/SettingsModule.php b/modules.local/paypal-pos-settings/src/SettingsModule.php index 06090b1..3c711cb 100644 --- a/modules.local/paypal-pos-settings/src/SettingsModule.php +++ b/modules.local/paypal-pos-settings/src/SettingsModule.php @@ -4,40 +4,30 @@ namespace Syde\PayPal\PointOfSale\Settings; -use Dhii\Container\ServiceProvider; -use Dhii\Modular\Module\ModuleInterface; -use Syde\PayPal\PointOfSale\BootableProviderAwareTrait; -use Syde\PayPal\PointOfSale\BootableProviderModuleInterface; -use Interop\Container\ServiceProviderInterface; +use Inpsyde\Modularity\Module\ExecutableModule; +use Inpsyde\Modularity\Module\ModuleClassNameIdTrait; +use Inpsyde\Modularity\Module\ServiceModule; use Psr\Container\ContainerInterface; -class SettingsModule implements ModuleInterface, BootableProviderModuleInterface +class SettingsModule implements ServiceModule, ExecutableModule { - use BootableProviderAwareTrait; + use ModuleClassNameIdTrait; - /** - * @inheritDoc - */ - public function setup(): ServiceProviderInterface + public function services(): array { - return new ServiceProvider( - require __DIR__ . '/../services.php', - require __DIR__ . '/../extensions.php' - ); + return require __DIR__ . '/../services.php'; } - /** - * @inheritDoc - */ - public function run(ContainerInterface $container): void + public function run(ContainerInterface $container): bool { if (!is_admin()) { - return; + return true; } - $this->bootProviders( - $container, - ...$container->get('paypal-pos.settings.provider') - ); + foreach ($container->get('paypal-pos.settings.provider') as $provider) { + $provider->boot($container); + } + + return true; } } diff --git a/modules.local/paypal-pos-settings/src/WC/ZettleIntegration.php b/modules.local/paypal-pos-settings/src/WC/ZettleIntegration.php index 0bf9682..c370cf6 100644 --- a/modules.local/paypal-pos-settings/src/WC/ZettleIntegration.php +++ b/modules.local/paypal-pos-settings/src/WC/ZettleIntegration.php @@ -4,8 +4,8 @@ namespace Syde\PayPal\PointOfSale\Settings\WC; -use Dhii\Collection\MutableContainerInterface; use Exception; +use Syde\PayPal\PointOfSale\Container\WritableContainerInterface; use Syde\PayPal\PointOfSale\Onboarding\OnboardingState as S; use Syde\PayPal\PointOfSale\Settings\FieldRenderer\FieldRendererInterface; use RuntimeException; @@ -34,7 +34,7 @@ class ZettleIntegration extends WC_Settings_API private $readonlyFieldTypes = ['title', 'zettle-onboarding']; /** - * @var MutableContainerInterface + * @var WritableContainerInterface */ private $container; @@ -44,7 +44,7 @@ public function __construct( string $currentState, array $formFields, callable $isIntegrationPage, - MutableContainerInterface $container, + WritableContainerInterface $container, FieldRendererInterface ...$renderers ) { diff --git a/modules.local/paypal-pos-sync/composer.json b/modules.local/paypal-pos-sync/composer.json index b764004..ce45e1f 100644 --- a/modules.local/paypal-pos-sync/composer.json +++ b/modules.local/paypal-pos-sync/composer.json @@ -8,7 +8,7 @@ } ], "require": { - "dhii/module-interface": "^0.2 || ^0.3", + "inpsyde/modularity": "^1.7", "inpsyde/wc-product-contracts": "*" }, "autoload": { diff --git a/modules.local/paypal-pos-sync/extensions.php b/modules.local/paypal-pos-sync/extensions.php index aadb739..ff57649 100644 --- a/modules.local/paypal-pos-sync/extensions.php +++ b/modules.local/paypal-pos-sync/extensions.php @@ -12,7 +12,7 @@ return [ 'paypal-pos.settings.fields.registry' => - static function (ContainerInterface $container, array $previous): array { + static function (array $previous, ContainerInterface $container): array { return array_merge( $previous, [ @@ -61,7 +61,7 @@ static function (ContainerInterface $container, array $previous): array { ); }, 'paypal-pos.sdk.filters' => - static function (ContainerInterface $container, array $previous): array { + static function (array $previous, ContainerInterface $container): array { $settings = $container->get('paypal-pos.settings'); if (!$settings->has('sync_price_strategy')) { return $previous; @@ -77,8 +77,8 @@ static function (ContainerInterface $container, array $previous): array { }, 'inpsyde.wc-lifecycle-events.products.listener-provider' => static function ( - ContainerInterface $container, - ProductEventListenerRegistry $registry + ProductEventListenerRegistry $registry, + ContainerInterface $container ): ProductEventListenerRegistry { $registry->onPropertyChange( 'stock_quantity', diff --git a/modules.local/paypal-pos-sync/module.php b/modules.local/paypal-pos-sync/module.php index cf3a8c7..4ffefc0 100644 --- a/modules.local/paypal-pos-sync/module.php +++ b/modules.local/paypal-pos-sync/module.php @@ -4,8 +4,6 @@ namespace Syde\PayPal\PointOfSale\Sync; -use Dhii\Modular\Module\ModuleInterface; - -return static function (): ModuleInterface { +return static function (): SyncModule { return new SyncModule(); }; diff --git a/modules.local/paypal-pos-sync/src/SyncModule.php b/modules.local/paypal-pos-sync/src/SyncModule.php index 8cd391b..31bf602 100644 --- a/modules.local/paypal-pos-sync/src/SyncModule.php +++ b/modules.local/paypal-pos-sync/src/SyncModule.php @@ -4,31 +4,29 @@ namespace Syde\PayPal\PointOfSale\Sync; -use Dhii\Container\ServiceProvider; -use Dhii\Modular\Module\ModuleInterface; use Exception; -use Interop\Container\ServiceProviderInterface; +use Inpsyde\Modularity\Module\ExecutableModule; +use Inpsyde\Modularity\Module\ExtendingModule; +use Inpsyde\Modularity\Module\ModuleClassNameIdTrait; +use Inpsyde\Modularity\Module\ServiceModule; use Psr\Container\ContainerInterface; use WP_CLI; -class SyncModule implements ModuleInterface +class SyncModule implements ServiceModule, ExtendingModule, ExecutableModule { + use ModuleClassNameIdTrait; - /** - * @inheritDoc - */ - public function setup(): ServiceProviderInterface + public function services(): array { - return new ServiceProvider( - require __DIR__ . '/../services.php', - require __DIR__ . '/../extensions.php' - ); + return require __DIR__ . '/../services.php'; } - /** - * @inheritDoc - */ - public function run(ContainerInterface $container): void + public function extensions(): array + { + return require __DIR__ . '/../extensions.php'; + } + + public function run(ContainerInterface $container): bool { if (defined('WP_CLI') && WP_CLI) { try { @@ -79,5 +77,7 @@ public function run(ContainerInterface $container): void $logger->debug('Settings check failed. ' . $exception->getMessage()); } } + + return true; } } diff --git a/modules.local/paypal-pos-webhooks/composer.json b/modules.local/paypal-pos-webhooks/composer.json index 2cbc9dd..bc6a31e 100644 --- a/modules.local/paypal-pos-webhooks/composer.json +++ b/modules.local/paypal-pos-webhooks/composer.json @@ -18,7 +18,7 @@ } ], "require": { - "dhii/module-interface": "^0.2 || ^0.3", + "inpsyde/modularity": "^1.7", "inpsyde/inpsyde-queue": "*", "inpsyde/paypal-pos-php-sdk": "*" }, diff --git a/modules.local/paypal-pos-webhooks/src/WebhookModule.php b/modules.local/paypal-pos-webhooks/src/WebhookModule.php index 24404e4..4385ffc 100644 --- a/modules.local/paypal-pos-webhooks/src/WebhookModule.php +++ b/modules.local/paypal-pos-webhooks/src/WebhookModule.php @@ -4,33 +4,31 @@ namespace Syde\PayPal\PointOfSale\Webhooks; -use Dhii\Container\ServiceProvider; -use Dhii\Modular\Module\ModuleInterface; use Exception; +use Inpsyde\Modularity\Module\ExecutableModule; +use Inpsyde\Modularity\Module\ModuleClassNameIdTrait; +use Inpsyde\Modularity\Module\ServiceModule; use Syde\PayPal\PointOfSale\Webhooks\Rest\Endpoint; use Syde\PayPal\PointOfSale\Webhooks\Rest\Verifier; -use Interop\Container\ServiceProviderInterface; use Psr\Container\ContainerInterface; use WP_CLI; -class WebhookModule implements ModuleInterface +class WebhookModule implements ServiceModule, ExecutableModule { + use ModuleClassNameIdTrait; /** * @inheritDoc */ - public function setup(): ServiceProviderInterface + public function services(): array { - return new ServiceProvider( - require __DIR__ . '/../services.php', - require __DIR__ . '/../extensions.php' - ); + return require __DIR__ . '/../services.php'; } /** * @inheritDoc */ - public function run(ContainerInterface $container): void + public function run(ContainerInterface $container): bool { add_action( 'init', @@ -55,6 +53,8 @@ static function () use ($bootstrap) { $bootstrap->deactivate(); } ); + + return true; } private function registerCliCommand(ContainerInterface $container) diff --git a/modules.local/paypal-pos-webhooks/src/WebhookStorage.php b/modules.local/paypal-pos-webhooks/src/WebhookStorage.php index 682ff9b..ef4f427 100644 --- a/modules.local/paypal-pos-webhooks/src/WebhookStorage.php +++ b/modules.local/paypal-pos-webhooks/src/WebhookStorage.php @@ -4,7 +4,7 @@ namespace Syde\PayPal\PointOfSale\Webhooks; -use Dhii\Collection\MutableContainerInterface; +use Syde\PayPal\PointOfSale\Container\WritableContainerInterface; use Syde\PayPal\PointOfSale\PhpSdk\API\Webhooks\Entity\RegisteredWebhook; use Syde\PayPal\PointOfSale\PhpSdk\API\Webhooks\Entity\Webhook; use Syde\PayPal\PointOfSale\PhpSdk\API\Webhooks\Entity\WebhookFactory; @@ -19,7 +19,7 @@ class WebhookStorage implements WebhookStorageInterface private $webhookFactory; /** - * @var MutableContainerInterface + * @var WritableContainerInterface */ private $optionContainer; @@ -37,13 +37,13 @@ class WebhookStorage implements WebhookStorageInterface * WpOptionWebhookStorage constructor. * * @param WebhookFactory $webhookFactory - * @param MutableContainerInterface $optionContainer + * @param WritableContainerInterface $optionContainer * @param string $optionKey * @param array $defaultConfig */ public function __construct( WebhookFactory $webhookFactory, - MutableContainerInterface $optionContainer, + WritableContainerInterface $optionContainer, string $optionKey, array $defaultConfig ) { diff --git a/paypal-point-of-sale.php b/paypal-point-of-sale.php index 4171397..9b3928e 100644 --- a/paypal-point-of-sale.php +++ b/paypal-point-of-sale.php @@ -27,8 +27,8 @@ namespace Syde\PayPal\PointOfSale; -use Dhii\Validation\Exception\ValidationFailedExceptionInterface; -use Psr\Container\ContainerInterface; +use Inpsyde\Modularity\Package; +use Syde\PayPal\PointOfSale\Validation\ValidationFailedException; (static function () { /** @@ -84,16 +84,16 @@ static function () use ($message) { include_once __DIR__ . '/vendor/autoload.php'; } - function init(): ?ContainerInterface + function init(): ?Package { static $initialized; - static $container; + static $package; if (!$initialized) { try { - $container = (require __DIR__ . '/bootstrap.php')(__DIR__, true); - } catch (ValidationFailedExceptionInterface $exc) { + $package = (require __DIR__ . '/bootstrap.php')(__FILE__, true); + } catch (ValidationFailedException $exc) { $messages = array_map(static function ($error): string { - if ($error instanceof ValidationFailedExceptionInterface) { + if ($error instanceof ValidationFailedException) { return $error->getMessage(); } return (string) $error; @@ -109,18 +109,20 @@ function init(): ?ContainerInterface $initialized = true; } - return $container; + return $package; } add_action( 'plugins_loaded', static function () { - $container = init(); + $package = init(); - if (!$container) { + if (!$package) { return; } + $container = $package->container(); + // IZET-356, looks like there is no good built-in hook in WP for plugin upgrades $version = $container->get('paypal-pos.plugin.properties')->version(); $versionOptionName = $container->get('paypal-pos.version-option-key'); diff --git a/phpunit.sh b/phpunit.sh index dfeb62a..8727109 100755 --- a/phpunit.sh +++ b/phpunit.sh @@ -18,22 +18,22 @@ while [[ $# -gt 0 ]]; do done runTest() { - dir=$(dirname $1) + dir=$(dirname "$1") if [ ! -d "$dir/vendor" ]; then echo "Running 'composer install' in $dir" - (cd $dir && composer install --prefer-dist --no-progress --no-suggest) + (cd "$dir" && composer install --prefer-dist --no-progress --no-suggest) fi echo "Running PHPUnit in $dir" - cd $dir + cd "$dir" vendor/bin/phpunit --stop-on-failure --exclude-group sync if [ "$NO_SYNC" == false ]; then vendor/bin/phpunit --stop-on-failure --group sync fi } -runTest $DIR/phpunit.xml.dist +runTest "$DIR/phpunit.xml.dist" for config in $DIR/modules/*/phpunit.xml.dist; do - runTest $config + runTest "$config" done diff --git a/src/BootableProviderAwareTrait.php b/src/BootableProviderAwareTrait.php deleted file mode 100644 index b70556f..0000000 --- a/src/BootableProviderAwareTrait.php +++ /dev/null @@ -1,21 +0,0 @@ -boot($container); - } - } -} diff --git a/src/BootableProviderModuleInterface.php b/src/BootableProviderModuleInterface.php deleted file mode 100644 index 9f56450..0000000 --- a/src/BootableProviderModuleInterface.php +++ /dev/null @@ -1,17 +0,0 @@ -has($id)) { $exceptionMessage = sprintf( @@ -42,7 +40,7 @@ public function get($id) /** * @inheritDoc */ - public function has($id) + public function has(string $id): bool { return array_key_exists($id, $this->options); } @@ -50,7 +48,7 @@ public function has($id) /** * @inheritDoc */ - public function set($key, $value): void + public function set(string $key, mixed $value): void { $this->options[$key] = $value; } diff --git a/src/Container/ClearableContainerInterface.php b/src/Container/ClearableContainerInterface.php new file mode 100644 index 0000000..e0260d1 --- /dev/null +++ b/src/Container/ClearableContainerInterface.php @@ -0,0 +1,11 @@ +optionKey, []); } - public function get($id) + public function get(string $id) { if ($this->has($id)) { return $this->options[$id]; @@ -49,12 +47,12 @@ public function get($id) }; } - public function has($id) + public function has(string $id): bool { return isset($this->options[$id]); } - public function set(string $key, $value): void + public function set(string $key, mixed $value): void { $this->options[$key] = $value; update_option($this->optionKey, $this->options); diff --git a/src/Container/WritableContainerInterface.php b/src/Container/WritableContainerInterface.php new file mode 100644 index 0000000..7dbe257 --- /dev/null +++ b/src/Container/WritableContainerInterface.php @@ -0,0 +1,15 @@ +get('paypal-pos.clear-cache')); + + return true; } /** diff --git a/src/Validation/CallbackValidator.php b/src/Validation/CallbackValidator.php new file mode 100644 index 0000000..0fd7d8f --- /dev/null +++ b/src/Validation/CallbackValidator.php @@ -0,0 +1,32 @@ +callback = $callback; + } + + /** + * phpcs:disable Inpsyde.CodeQuality.ArgumentTypeDeclaration.NoArgumentType + * @param mixed $value + */ + public function validate($value): void + { + $error = ($this->callback)($value); + + if ($error !== null) { + throw new ValidationFailedException((string) $error); + } + } +} diff --git a/src/Validation/CompositeValidator.php b/src/Validation/CompositeValidator.php new file mode 100644 index 0000000..f88795b --- /dev/null +++ b/src/Validation/CompositeValidator.php @@ -0,0 +1,43 @@ +validators = $validators; + } + + /** + * phpcs:disable Inpsyde.CodeQuality.ArgumentTypeDeclaration.NoArgumentType + * @param mixed $value + */ + public function validate($value): void + { + $errors = []; + + foreach ($this->validators as $validator) { + try { + $validator->validate($value); + } catch (ValidationFailedException $exception) { + $errors[] = $exception; + } + } + + if ($errors) { + throw new ValidationFailedException('Validation failed', $errors); + } + } +} diff --git a/src/Validation/RequiredExtensionsValidator.php b/src/Validation/RequiredExtensionsValidator.php index 4c33d98..2b51501 100644 --- a/src/Validation/RequiredExtensionsValidator.php +++ b/src/Validation/RequiredExtensionsValidator.php @@ -4,8 +4,8 @@ namespace Syde\PayPal\PointOfSale\Validation; -use Dhii\Validation\ValidatorInterface; -use Dhii\Validator\CallbackValidator; +use Syde\PayPal\PointOfSale\Validation\CallbackValidator; +use Syde\PayPal\PointOfSale\Validation\ValidatorInterface; /** * Checks that PHP extensions (functions) are available. diff --git a/src/Validation/RequiredPluginsValidator.php b/src/Validation/RequiredPluginsValidator.php index 93396ce..d919a40 100644 --- a/src/Validation/RequiredPluginsValidator.php +++ b/src/Validation/RequiredPluginsValidator.php @@ -4,8 +4,8 @@ namespace Syde\PayPal\PointOfSale\Validation; -use Dhii\Validation\ValidatorInterface; -use Dhii\Validator\CallbackValidator; +use Syde\PayPal\PointOfSale\Validation\CallbackValidator; +use Syde\PayPal\PointOfSale\Validation\ValidatorInterface; use function is_plugin_active; use function is_plugin_active_for_network; diff --git a/src/Validation/ValidationFailedException.php b/src/Validation/ValidationFailedException.php new file mode 100644 index 0000000..6af7310 --- /dev/null +++ b/src/Validation/ValidationFailedException.php @@ -0,0 +1,28 @@ +errors = $errors; + } + + public function getValidationErrors(): array + { + return $this->errors; + } +} diff --git a/src/Validation/ValidatorInterface.php b/src/Validation/ValidatorInterface.php new file mode 100644 index 0000000..63be997 --- /dev/null +++ b/src/Validation/ValidatorInterface.php @@ -0,0 +1,15 @@ + static function ( - C $container, - LoggerInterface $previous + LoggerInterface $previous, + C $container ): LoggerInterface { return $container->get('paypal-pos.logger')->addLogger($previous); }, 'inpsyde.queue.logger' => static function ( - C $container, - LoggerInterface $previous + LoggerInterface $previous, + C $container ): LoggerInterface { return $container->get('paypal-pos.logger')->addLogger($previous); }, 'paypal-pos.webhook.logger' => static function ( - C $container, - LoggerInterface $previous + LoggerInterface $previous, + C $container ): LoggerInterface { return $container->get('paypal-pos.logger')->addLogger($previous); }, @@ -37,26 +37,27 @@ * by passing the SettingsContainer into the CredentialsContainer */ 'paypal-pos.oauth.credentials.parent' => static function ( + ?C $previous, C $container ): C { return $container->get('paypal-pos.settings'); }, 'paypal-pos.sdk.rest-client' => - static function (C $container, Psr18RestClient $client): Psr18RestClient { + static function (Psr18RestClient $client, C $container): Psr18RestClient { $proxyFactory = $container->get('inpsyde.debug.proxy-factory'); assert($proxyFactory instanceof DebugProxyFactory); return $proxyFactory->forInstanceMethods($client); }, 'inpsyde.queue.exception-handler' => - static function (C $container, callable $previous): callable { + static function (callable $previous, C $container): callable { return static function (Throwable $exception) use ($previous, $container) { $previous($exception); $container->get('inpsyde.debug.exception-handler')->handle($exception); }; }, - 'inpsyde.wc-status-report.items' => static function (C $container, array $items): array { + 'inpsyde.wc-status-report.items' => static function (array $items, C $container): array { $factory = $container->get('inpsyde.wc-status-report.item-factory'); assert($factory instanceof ReportItemFactoryInterface); diff --git a/src/services.php b/src/services.php index dcaa02d..f77e2ac 100644 --- a/src/services.php +++ b/src/services.php @@ -4,10 +4,10 @@ namespace Syde\PayPal\PointOfSale; -use Dhii\Collection\MutableContainerInterface; -use Dhii\Validation\ValidatorInterface; -use Dhii\Validator\CompositeValidator; use Syde\PayPal\PointOfSale\Container\WpOptionContainer; +use Syde\PayPal\PointOfSale\Container\WritableContainerInterface; +use Syde\PayPal\PointOfSale\Validation\CompositeValidator; +use Syde\PayPal\PointOfSale\Validation\ValidatorInterface; use Syde\PayPal\PointOfSale\Http\PageReloader; use Syde\PayPal\PointOfSale\Http\PageReloaderInterface; use Syde\PayPal\PointOfSale\Logging\Logger\CompoundLogger; @@ -97,22 +97,22 @@ 'paypal-pos.http.page-reloader' => static function (C $container): PageReloaderInterface { return new PageReloader(); }, - 'paypal-pos.settings' => static function (): MutableContainerInterface { + 'paypal-pos.settings' => static function (): WritableContainerInterface { return new WpOptionContainer('woocommerce_zettle_settings'); }, - 'paypal-pos.setup-info' => static function (): MutableContainerInterface { + 'paypal-pos.setup-info' => static function (): WritableContainerInterface { return new WpOptionContainer('woocommerce_zettle_info'); }, 'paypal-pos.sdk.integration-id.container' => - static function (C $container): MutableContainerInterface { + static function (C $container): WritableContainerInterface { return $container->get('paypal-pos.settings'); }, 'paypal-pos.oauth.token-storage.container' => - static function (C $container): MutableContainerInterface { + static function (C $container): WritableContainerInterface { return $container->get('paypal-pos.settings'); }, 'paypal-pos.webhook.storage.container' => - static function (C $container): MutableContainerInterface { + static function (C $container): WritableContainerInterface { return $container->get('paypal-pos.settings'); }, 'paypal-pos.logger' => static function (C $container): CompoundLogger { diff --git a/tests/PHPUnit/Helper/AuthenticatedRestRequestTestCase.php b/tests/PHPUnit/Helper/AuthenticatedRestRequestTestCase.php index 9a51939..c41ea84 100644 --- a/tests/PHPUnit/Helper/AuthenticatedRestRequestTestCase.php +++ b/tests/PHPUnit/Helper/AuthenticatedRestRequestTestCase.php @@ -69,7 +69,7 @@ function (): int { ); $this->injectExtension( 'paypal-pos.oauth.credentials.parent', - function (ContainerInterface $container) { + function ($previous, ContainerInterface $container) { return new EnvMapCredentialsContainer(); } ); diff --git a/tests/PHPUnit/Helper/EnvMapCredentialsContainer.php b/tests/PHPUnit/Helper/EnvMapCredentialsContainer.php index ba230b2..d150386 100644 --- a/tests/PHPUnit/Helper/EnvMapCredentialsContainer.php +++ b/tests/PHPUnit/Helper/EnvMapCredentialsContainer.php @@ -21,7 +21,7 @@ public function __construct() /** * @inheritDoc */ - public function get($id) + public function get(string $id) { if (!$this->has($id)) { throw new class extends \Exception implements NotFoundExceptionInterface { @@ -35,7 +35,7 @@ public function get($id) /** * @inheritDoc */ - public function has($id) + public function has(string $id): bool { return array_key_exists($id, $this->envMap); } diff --git a/tests/PHPUnit/Helper/ModuleContainerAwareTestCase.php b/tests/PHPUnit/Helper/ModuleContainerAwareTestCase.php index ce88a07..21bad17 100644 --- a/tests/PHPUnit/Helper/ModuleContainerAwareTestCase.php +++ b/tests/PHPUnit/Helper/ModuleContainerAwareTestCase.php @@ -7,14 +7,13 @@ namespace Syde\PayPal\PointOfSale\Test; -use Dhii\Container\CachingContainer; -use Dhii\Container\CompositeCachingServiceProvider; -use Dhii\Container\DelegatingContainer; -use Dhii\Container\ProxyContainer; -use Dhii\Container\ServiceProvider; -use Dhii\Modular\Module\ModuleInterface; +use Inpsyde\Modularity\Module\ExtendingModule; +use Inpsyde\Modularity\Module\ModuleClassNameIdTrait; +use Inpsyde\Modularity\Module\ServiceModule; +use Inpsyde\Modularity\Package; +use Inpsyde\Modularity\Properties\LibraryProperties; +use Psr\Container\ContainerInterface; use Syde\PayPal\PointOfSale\PluginModule; -use Interop\Container\ServiceProviderInterface; class ModuleContainerAwareTestCase extends MonkeryTestCase { @@ -22,11 +21,11 @@ class ModuleContainerAwareTestCase extends MonkeryTestCase private $delayedModuleContainerSetup = false; /** - * @var DelegatingContainer + * @var ContainerInterface */ private $container; - private static $providers = []; + private static $modules = []; private $currentFactories = []; @@ -35,13 +34,13 @@ class ModuleContainerAwareTestCase extends MonkeryTestCase public static function setUpBeforeClass(): void { $rootDir = dirname(__DIR__, 3); - $modules = [new PluginModule($rootDir)]; + self::$modules = [new PluginModule()]; foreach (glob($rootDir.'/modules/*/module.php') as $moduleFile) { - $modules[] = (@require $moduleFile)(); + $module = (@require $moduleFile)(); + if ($module !== null) { + self::$modules[] = $module; + } } - self::$providers = array_map(function (ModuleInterface $module): ServiceProviderInterface { - return $module->setup(); - }, $modules); } protected function setUp(): void @@ -65,13 +64,52 @@ protected function delayModuleContainerSetup() protected function setupModuleContainer() { - $providers = self::$providers; - $providers[] = new ServiceProvider($this->currentFactories, $this->currentExtensions); - $provider = new CompositeCachingServiceProvider($providers); - $proxy = new ProxyContainer(); - $container = new CachingContainer(new DelegatingContainer($provider, $proxy)); - $proxy->setInnerContainer($container); - $this->container = $proxy; + $rootDir = dirname(__DIR__, 3); + $properties = LibraryProperties::new($rootDir.'/composer.json'); + $package = Package::new($properties); + + foreach (self::$modules as $module) { + $package->addModule($module); + } + + $factories = $this->currentFactories; + $extensions = $this->currentExtensions; + if (!empty($factories) || !empty($extensions)) { + $package->addModule( + new class ($factories, $extensions) implements ServiceModule, ExtendingModule { + use ModuleClassNameIdTrait; + + /** + * @var array + */ + private $factories; + + /** + * @var array + */ + private $extensions; + + public function __construct(array $factories, array $extensions) + { + $this->factories = $factories; + $this->extensions = $extensions; + } + + public function services(): array + { + return $this->factories; + } + + public function extensions(): array + { + return $this->extensions; + } + } + ); + } + + $package->build(); + $this->container = $package->container(); } protected function tearDown(): void diff --git a/tests/PHPUnit/Helper/WooCommerceConfigContainerFaker.php b/tests/PHPUnit/Helper/WooCommerceConfigContainerFaker.php index 2c96d9f..03b3bb5 100644 --- a/tests/PHPUnit/Helper/WooCommerceConfigContainerFaker.php +++ b/tests/PHPUnit/Helper/WooCommerceConfigContainerFaker.php @@ -36,7 +36,7 @@ public function __construct(array $config = []) * * @throws \Exception */ - public function get($id) + public function get(string $id) { if (!$this->has($id)) { throw new RuntimeException("Given {$id} WooCommerce Setting doesnt exist."); @@ -50,7 +50,7 @@ public function get($id) * * @return bool */ - public function has($id): bool + public function has(string $id): bool { return array_key_exists($id, $this->configMap); } diff --git a/tests/PHPUnit/Integration/Auth/CredentialsTest.php b/tests/PHPUnit/Integration/Auth/CredentialsTest.php index 498d737..2f940ae 100644 --- a/tests/PHPUnit/Integration/Auth/CredentialsTest.php +++ b/tests/PHPUnit/Integration/Auth/CredentialsTest.php @@ -29,7 +29,7 @@ public function testCredentialsContainer() { $this->injectExtension( 'paypal-pos.oauth.credentials.parent', - static function (ContainerInterface $container, ContainerInterface $settings) { + static function (?ContainerInterface $previous, ContainerInterface $container) { return Mockery::spy(new EnvMapCredentialsContainer()); } ); diff --git a/tests/PHPUnit/Integration/Onboarding/OnboardingStateMachineTest.php b/tests/PHPUnit/Integration/Onboarding/OnboardingStateMachineTest.php index b564dfb..05994aa 100644 --- a/tests/PHPUnit/Integration/Onboarding/OnboardingStateMachineTest.php +++ b/tests/PHPUnit/Integration/Onboarding/OnboardingStateMachineTest.php @@ -22,7 +22,7 @@ class OnboardingStateMachineTest extends ModuleContainerAwareTestCase private const STATE_OPTION_NAME = 'onboarding.current-state'; /** - * @var \Dhii\Collection\MutableContainerInterface + * @var \Syde\PayPal\PointOfSale\Container\WritableContainerInterface */ private $optionsContainer; diff --git a/tests/PHPUnit/Integration/Queue/InitialSyncTest.php b/tests/PHPUnit/Integration/Queue/InitialSyncTest.php index 56ff2f2..de8b00a 100644 --- a/tests/PHPUnit/Integration/Queue/InitialSyncTest.php +++ b/tests/PHPUnit/Integration/Queue/InitialSyncTest.php @@ -58,25 +58,25 @@ function (ContainerInterface $container): QueueWalker { $this->injectExtension( 'paypal-pos.job.'.EnqueueProductSyncJob::TYPE, - function (ContainerInterface $container, Job $previous): Job { + function (Job $previous, ContainerInterface $container): Job { return Mockery::spy($previous); } ); $this->injectExtension( 'paypal-pos.job.'.ExportProductJob::TYPE, - function (ContainerInterface $container, Job $previous): Job { + function (Job $previous, ContainerInterface $container): Job { return Mockery::spy($previous); } ); $this->injectExtension( 'paypal-pos.job.'.SyncStockJob::TYPE, - function (ContainerInterface $container, Job $previous): Job { + function (Job $previous, ContainerInterface $container): Job { return Mockery::spy($previous); } ); $this->injectExtension( 'paypal-pos.job.'.SetInventoryTrackingJob::TYPE, - function (ContainerInterface $container, Job $previous): Job { + function (Job $previous, ContainerInterface $container): Job { return Mockery::spy($previous); } ); diff --git a/tests/PHPUnit/Integration/Webhook/InventoryBalanceChangedHandlerTest.php b/tests/PHPUnit/Integration/Webhook/InventoryBalanceChangedHandlerTest.php index ff95271..2a76956 100644 --- a/tests/PHPUnit/Integration/Webhook/InventoryBalanceChangedHandlerTest.php +++ b/tests/PHPUnit/Integration/Webhook/InventoryBalanceChangedHandlerTest.php @@ -104,7 +104,7 @@ function () use ($expectedChange, $successfullyExecuted) { $this->injectExtension( 'paypal-pos.webhook.handlers.inventory-balance-changed', - function (ContainerInterface $container, WebhookHandler $previous): InventoryBalanceChangedHandler { + function (WebhookHandler $previous, ContainerInterface $container): InventoryBalanceChangedHandler { return Mockery::spy($previous); } );