{"id":20678870,"url":"https://github.com/phpgt/servicecontainer","last_synced_at":"2026-04-18T21:01:43.567Z","repository":{"id":37899755,"uuid":"369590494","full_name":"phpgt/ServiceContainer","owner":"phpgt","description":"Centralised container of a project's core objects.","archived":false,"fork":false,"pushed_at":"2024-01-12T16:12:26.000Z","size":99,"stargazers_count":0,"open_issues_count":5,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-07T12:08:36.914Z","etag":null,"topics":["autowiring","dependency-injection","dependency-injection-container","maintainability","service-container","testability"],"latest_commit_sha":null,"homepage":"https://www.php.gt/servicecontainer","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phpgt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["phpgt"]}},"created_at":"2021-05-21T16:13:36.000Z","updated_at":"2023-12-05T21:26:44.000Z","dependencies_parsed_at":"2023-02-11T11:30:28.185Z","dependency_job_id":"38fe2cc6-5926-4c57-a5a5-8656f0eaae0c","html_url":"https://github.com/phpgt/ServiceContainer","commit_stats":{"total_commits":31,"total_committers":2,"mean_commits":15.5,"dds":"0.22580645161290325","last_synced_commit":"653f928d8a0a658d0589135efe144520d32c2b4a"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpgt%2FServiceContainer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpgt%2FServiceContainer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpgt%2FServiceContainer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpgt%2FServiceContainer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phpgt","download_url":"https://codeload.github.com/phpgt/ServiceContainer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242911375,"owners_count":20205486,"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":["autowiring","dependency-injection","dependency-injection-container","maintainability","service-container","testability"],"created_at":"2024-11-16T21:22:52.704Z","updated_at":"2026-04-18T21:01:43.562Z","avatar_url":"https://github.com/phpgt.png","language":"PHP","funding_links":["https://github.com/sponsors/phpgt"],"categories":[],"sub_categories":[],"readme":"Centralised container of a project's core objects.\n==================================================\n\nWhen PHP applications have a lot of classes, it's important to use [dependency injection][dependency-injection] techniques to keep your code maintainable and testable; rather than constructing objects within the functions they are used, pass the objects into the function via parameters.\n\nWithin this repository, a `Container` is an object that can be assigned pre-constructed instances of objects, and an `Injector` is an object that can automatically invoke other objects' methods with the matching instances from the Container.\n\nThere are no rules to how this repository should be used. You may want to have a single Container accessible to a single layer of your code, or you may want to have multiple Containers within your application to provide a different pool of object instances to different areas of your code.\n\nThis repository is used within [WebEngine][webengine] to automatically invoke Page Logic functions, allowing the developer to have a single point within the application that is responsible for the object access of all first and third party classes.\n\n***\n\n\u003ca href=\"https://github.com/PhpGt/ServiceContainer/actions\" target=\"_blank\"\u003e\n\t\u003cimg src=\"https://badge.status.php.gt/servicecontainer-build.svg\" alt=\"Build status\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://app.codacy.com/gh/PhpGt/ServiceContainer\" target=\"_blank\"\u003e\n\t\u003cimg src=\"https://badge.status.php.gt/servicecontainer-quality.svg\" alt=\"Code quality\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://app.codecov.io/gh/PhpGt/ServiceContainer\" target=\"_blank\"\u003e\n\t\u003cimg src=\"https://badge.status.php.gt/servicecontainer-coverage.svg\" alt=\"Code coverage\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://packagist.org/packages/PhpGt/ServiceContainer\" target=\"_blank\"\u003e\n\t\u003cimg src=\"https://badge.status.php.gt/servicecontainer-version.svg\" alt=\"Current version\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"http://www.php.gt/servicecontainer\" target=\"_blank\"\u003e\n\t\u003cimg src=\"https://badge.status.php.gt/servicecontainer-docs.svg\" alt=\"PHP.G/ServiceContainer documentation\" /\u003e\n\u003c/a\u003e\n\n[dependency-injection]: https://martinfowler.com/articles/injection.html\n[webengine]: https://www.php.gt/webengine\n\n# Proudly sponsored by\n\n[JetBrains Open Source sponsorship program](https://www.jetbrains.com/community/opensource/)\n\n[![JetBrains logo.](https://resources.jetbrains.com/storage/products/company/brand/logos/jetbrains.svg)](https://www.jetbrains.com/community/opensource/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphpgt%2Fservicecontainer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphpgt%2Fservicecontainer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphpgt%2Fservicecontainer/lists"}