{"id":18929643,"url":"https://github.com/thecodingmachine/yaco-service-provider","last_synced_at":"2025-07-11T20:04:00.473Z","repository":{"id":57067897,"uuid":"52816482","full_name":"thecodingmachine/yaco-service-provider","owner":"thecodingmachine","description":"This package is a bridge between container-intop's service providers and YACO (the PSR-11 compliant container compiler).","archived":false,"fork":false,"pushed_at":"2016-04-11T16:26:46.000Z","size":8,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":6,"default_branch":"1.0","last_synced_at":"2025-07-10T11:11:33.361Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thecodingmachine.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-29T19:14:46.000Z","updated_at":"2016-02-29T19:22:00.000Z","dependencies_parsed_at":"2022-08-24T14:54:08.334Z","dependency_job_id":null,"html_url":"https://github.com/thecodingmachine/yaco-service-provider","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/thecodingmachine/yaco-service-provider","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodingmachine%2Fyaco-service-provider","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodingmachine%2Fyaco-service-provider/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodingmachine%2Fyaco-service-provider/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodingmachine%2Fyaco-service-provider/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thecodingmachine","download_url":"https://codeload.github.com/thecodingmachine/yaco-service-provider/tar.gz/refs/heads/1.0","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodingmachine%2Fyaco-service-provider/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264890087,"owners_count":23678833,"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-08T11:34:08.163Z","updated_at":"2025-07-11T20:04:00.442Z","avatar_url":"https://github.com/thecodingmachine.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/thecodingmachine/yaco-service-provider/badges/quality-score.png?b=1.0)](https://scrutinizer-ci.com/g/thecodingmachine/yaco-service-provider/?branch=1.0)\n[![Build Status](https://travis-ci.org/thecodingmachine/yaco-service-provider.svg?branch=1.0)](https://travis-ci.org/thecodingmachine/yaco-service-provider)\n[![Coverage Status](https://coveralls.io/repos/thecodingmachine/yaco-service-provider/badge.svg?branch=1.0\u0026service=github)](https://coveralls.io/github/thecodingmachine/yaco-service-provider?branch=1.0)\n\n# Bridge between container-interop's service providers and YACO\n\nThis package is a bridge between [container-interop's service providers](http://github.com/container-interop/service-provider) and [YACO, the PSR-11 compliant container compiler](http://github.com/thecodingmachine/yaco).\n\nUsing this package, you can use Yaco to generate PSR-11 compliant containers that contain the services provided by container-interop's service providers.\n\n## Installation\n\n```sh\ncomposer require thecodingmachine/yaco-service-provider\n```\n\n## Loading a service provider into Yaco\n\n```php\nuse TheCodingMachine\\Yaco\\Compiler;\nuse TheCodingMachine\\Yaco\\ServiceProvider\\ServiceProviderLoader;\n\n// Create your YACO compiler.\n$compiler = new Compiler();\n\n// Create your service provider loader\n$serviceProviderLoader = new ServiceProviderLoader($compiler);\n\n// Load service providers into Yaco:\n$serviceProviderLoader-\u003eload(MyServiceProvider::class);\n$serviceProviderLoader-\u003eload(MyOtherServiceProvider::class);\n\n// Services are now available in Yaco, we just need to dump the container:\n$code = $compiler-\u003ecompile('MyContainer');\nfile_put_contents(__DIR__.'/MyContainer.php', $code);\n```\n\n## Autodiscovering service providers using Puli\n\nIf the service providers you are loading are publishing themselves on Puli, you can easily use Puli's discovery mechanism to load the services:\n\n```php\n// The discoverAndLoad function takes a Puli discovery instance in parameter.\n// It will discover and load service providers automatically.\n$serviceProviderLoader-\u003ediscoverAndLoad($discovery)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecodingmachine%2Fyaco-service-provider","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthecodingmachine%2Fyaco-service-provider","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecodingmachine%2Fyaco-service-provider/lists"}