{"id":20903514,"url":"https://github.com/phly/zend-servicemanager-interop","last_synced_at":"2025-12-11T20:00:55.521Z","repository":{"id":57039011,"uuid":"56618562","full_name":"phly/zend-servicemanager-interop","owner":"phly","description":"Inject zend-servicemanager with results from service-provider instances.","archived":false,"fork":false,"pushed_at":"2016-04-19T17:56:22.000Z","size":21,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-01-19T13:49:59.616Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phly.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-04-19T17:46:21.000Z","updated_at":"2018-11-13T21:43:04.000Z","dependencies_parsed_at":"2022-08-24T00:51:17.413Z","dependency_job_id":null,"html_url":"https://github.com/phly/zend-servicemanager-interop","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phly%2Fzend-servicemanager-interop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phly%2Fzend-servicemanager-interop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phly%2Fzend-servicemanager-interop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phly%2Fzend-servicemanager-interop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phly","download_url":"https://codeload.github.com/phly/zend-servicemanager-interop/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243293795,"owners_count":20268142,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-18T13:13:52.395Z","updated_at":"2025-12-11T20:00:55.503Z","avatar_url":"https://github.com/phly.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# servicemanager-interop\n\n\u003e :warning: **Archived 2025-08-17**\n\u003e \n\u003e Use at your own risk.\n\n[![Build Status](https://secure.travis-ci.org/phly/zend-servicemanager-interop.svg?branch=master)](https://secure.travis-ci.org/phly/zend-servicemanager-interop)\n[![Coverage Status](https://coveralls.io/repos/github/phly/zend-servicemanager-interop/badge.svg?branch=master)](https://coveralls.io/github/phly/zend-servicemanager-interop?branch=master)\n\nUse [container-interop service providers](https://github.com/container-interop/service-provider/)\nwith [zend-servicemanager](https://zendframework.github.io/zend-servicemanager/).\n\n## Installation\n\n```console\n$ composer require phly/zend-servicemanager-interop\n```\n\n## Usage\n\n```php\nuse Zend\\ServiceManager\\Interop\\ConfigInjector;\nuse Zend\\ServiceManager\\Interop\\ProviderAggregate;\nuse Zend\\ServiceManager\\ServiceManager;\n\n// Get a list of service provider classes and aggregate them:\n$aggregate = new ProviderAggregate();\nforeach (include 'providers.php' as $provider) {\n    $aggregate-\u003eenqueue($provider);\n}\n\n// Create and inject a service manager with the providers:\n$container = (new ConfigInjector())-\u003einject($aggregate, new ServiceManager());\n```\n\n## Internals\n\n- `ProviderAggregate` allows passing either a class name of a provider, or an\n  instance. Internally, it creates instances from class names to ensure that\n  dequeued items are known-good types.\n- `ConfigInjector` will create a closure around factories, to curry arguments\n  and ensure the factories have no conflicts with how zend-servicemanager\n  invokes them.\n- `ConfigInjector` adds factories as delegators if the service is already\n  present in the zend-servicemanager instance. Again, the factory is wrapped in\n  a closure in order to curry arguments in the correct order.\n\n## Differences from service-provider\n\nThis implementation experiments a bit and allows the following as factory\narguments:\n\n- any valid PHP callable\n- FQCN arguments that resolve to functors\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphly%2Fzend-servicemanager-interop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphly%2Fzend-servicemanager-interop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphly%2Fzend-servicemanager-interop/lists"}