jascha030 / service-provider
Service Provider interface for usage with PSR-11 ContainerInterface, based on container-interop/service-provider.
1.0.0
2023-02-05 22:05 UTC
Requires
- php: ~8.0||~8.1||8.2
- psr/container: ^1||^2
Requires (Dev)
- roave/security-advisories: dev-latest
This package is not auto-updated.
Last update: 2025-03-04 06:43:32 UTC
README
Copy of container-interop/service-providers, which seems unmaintained, but states that is still a work in progress. Because of this, I made a copy with some slight edits, to use in personal projects.
Installation
composer require jascha030/service-provider
The interface
The interface is pretty self explainitory, read the README.md of container-interop/service-providers for more info.
<?php declare(strict_types=1); namespace Jascha030\DI\ServiceProvider; use Closure; use Psr\Container\ContainerInterface; /** * A service provider provides entries to a container. * * @see ContainerInterface */ interface ServiceProviderInterface { /** * @return iterable<class-string|int|string,callable|Closure> */ public function getFactories(): iterable; /** * @return iterable<class-string|int|string,callable|Closure> */ public function getExtensions(): iterable; }