Refactor app container to modularity.

This commit is contained in:
Pedro Silva 2023-11-23 17:43:56 +00:00
parent 42f995222d
commit 3be8563870
No known key found for this signature in database
GPG key ID: E2EE20C0669D24B3
22 changed files with 2367 additions and 45 deletions

View file

@ -0,0 +1,21 @@
<?php
declare(strict_types=1);
namespace WooCommerce\PayPalCommerce\Vendor\Inpsyde\Modularity\Module;
interface ServiceModule extends Module
{
/**
* Return application services' factories.
*
* Array keys will be services' IDs in the container, array values are callback that
* accepts a PSR-11 container as parameter and return an instance of the service.
* Services are "cached", so the given factory is called once the first time `get()` is called
* in the container, and on subsequent `get()` the same instance is returned again and again.
*
* @return array<string, callable(\WooCommerce\PayPalCommerce\Vendor\Psr\Container\ContainerInterface $container):mixed>
*/
public function services(): array;
}