onepix / psr11-container-interface-generic
A generic, type-safe container interface (PSR-compatible) with support for retrieving items of a specified type
Installs: 134
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/onepix/psr11-container-interface-generic
README
Config
<stubs> <file name="vendor/onepix/psr11-container-interface-generic/ContainerInterface.php"/> </stubs>
Usage
final class App { /** * @param ContainerInterface<Controller> $controllers */ public function __construct( private ContainerInterface $controllers, ) { } }
/** * @implements ContainerInterface<Controller> */ final class ControllerContainer implements ContainerInterface { public function get(string $id) {} public function has(string $id): bool {} }