{"id":18834326,"url":"https://github.com/chubbyphp/chubbyphp-laminas-config-factory","last_synced_at":"2025-07-29T05:34:51.768Z","repository":{"id":56952676,"uuid":"292936199","full_name":"chubbyphp/chubbyphp-laminas-config-factory","owner":"chubbyphp","description":"An abstract service factory for the laminas/laminas-servicemanager and any other dependency injection container who's been able to handle it's config, like chubbyphp/chubbyphp-container via chubbyphp/chubbyphp-laminas-config and many (Aura.Di, Pimple, Auryn, Symfony, PHP-DI) more.","archived":false,"fork":false,"pushed_at":"2025-03-12T14:09:20.000Z","size":38,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-14T05:10:01.784Z","etag":null,"topics":["chubbyphp","chubbyphp-container","laminas","mezzio","psr-11"],"latest_commit_sha":null,"homepage":"","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/chubbyphp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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,"zenodo":null}},"created_at":"2020-09-04T20:02:20.000Z","updated_at":"2025-03-12T14:09:24.000Z","dependencies_parsed_at":"2024-03-13T21:26:44.524Z","dependency_job_id":"20e58047-371f-48a1-b4ac-1900b9c05a5f","html_url":"https://github.com/chubbyphp/chubbyphp-laminas-config-factory","commit_stats":{"total_commits":23,"total_committers":3,"mean_commits":7.666666666666667,"dds":0.3913043478260869,"last_synced_commit":"601cec6cd1a44a5f05b41d46215f4bac869e7423"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/chubbyphp/chubbyphp-laminas-config-factory","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chubbyphp%2Fchubbyphp-laminas-config-factory","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chubbyphp%2Fchubbyphp-laminas-config-factory/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chubbyphp%2Fchubbyphp-laminas-config-factory/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chubbyphp%2Fchubbyphp-laminas-config-factory/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chubbyphp","download_url":"https://codeload.github.com/chubbyphp/chubbyphp-laminas-config-factory/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chubbyphp%2Fchubbyphp-laminas-config-factory/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267633677,"owners_count":24118778,"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","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["chubbyphp","chubbyphp-container","laminas","mezzio","psr-11"],"created_at":"2024-11-08T02:11:57.398Z","updated_at":"2025-07-29T05:34:51.742Z","avatar_url":"https://github.com/chubbyphp.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# chubbyphp-laminas-config-factory\n\n[![CI](https://github.com/chubbyphp/chubbyphp-laminas-config-factory/actions/workflows/ci.yml/badge.svg)](https://github.com/chubbyphp/chubbyphp-laminas-config-factory/actions/workflows/ci.yml)\n[![Coverage Status](https://coveralls.io/repos/github/chubbyphp/chubbyphp-laminas-config-factory/badge.svg?branch=master)](https://coveralls.io/github/chubbyphp/chubbyphp-laminas-config-factory?branch=master)\n[![Mutation testing badge](https://img.shields.io/endpoint?style=flat\u0026url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fchubbyphp%2Fchubbyphp-laminas-config-factory%2Fmaster)](https://dashboard.stryker-mutator.io/reports/github.com/chubbyphp/chubbyphp-laminas-config-factory/master)\n[![Latest Stable Version](https://poser.pugx.org/chubbyphp/chubbyphp-laminas-config-factory/v)](https://packagist.org/packages/chubbyphp/chubbyphp-laminas-config-factory)\n[![Total Downloads](https://poser.pugx.org/chubbyphp/chubbyphp-laminas-config-factory/downloads)](https://packagist.org/packages/chubbyphp/chubbyphp-laminas-config-factory)\n[![Monthly Downloads](https://poser.pugx.org/chubbyphp/chubbyphp-laminas-config-factory/d/monthly)](https://packagist.org/packages/chubbyphp/chubbyphp-laminas-config-factory)\n\n[![bugs](https://sonarcloud.io/api/project_badges/measure?project=chubbyphp_chubbyphp-laminas-config-factory\u0026metric=bugs)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-laminas-config-factory)\n[![code_smells](https://sonarcloud.io/api/project_badges/measure?project=chubbyphp_chubbyphp-laminas-config-factory\u0026metric=code_smells)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-laminas-config-factory)\n[![coverage](https://sonarcloud.io/api/project_badges/measure?project=chubbyphp_chubbyphp-laminas-config-factory\u0026metric=coverage)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-laminas-config-factory)\n[![duplicated_lines_density](https://sonarcloud.io/api/project_badges/measure?project=chubbyphp_chubbyphp-laminas-config-factory\u0026metric=duplicated_lines_density)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-laminas-config-factory)\n[![ncloc](https://sonarcloud.io/api/project_badges/measure?project=chubbyphp_chubbyphp-laminas-config-factory\u0026metric=ncloc)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-laminas-config-factory)\n[![sqale_rating](https://sonarcloud.io/api/project_badges/measure?project=chubbyphp_chubbyphp-laminas-config-factory\u0026metric=sqale_rating)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-laminas-config-factory)\n[![alert_status](https://sonarcloud.io/api/project_badges/measure?project=chubbyphp_chubbyphp-laminas-config-factory\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-laminas-config-factory)\n[![reliability_rating](https://sonarcloud.io/api/project_badges/measure?project=chubbyphp_chubbyphp-laminas-config-factory\u0026metric=reliability_rating)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-laminas-config-factory)\n[![security_rating](https://sonarcloud.io/api/project_badges/measure?project=chubbyphp_chubbyphp-laminas-config-factory\u0026metric=security_rating)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-laminas-config-factory)\n[![sqale_index](https://sonarcloud.io/api/project_badges/measure?project=chubbyphp_chubbyphp-laminas-config-factory\u0026metric=sqale_index)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-laminas-config-factory)\n[![vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=chubbyphp_chubbyphp-laminas-config-factory\u0026metric=vulnerabilities)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-laminas-config-factory)\n\n## Description\n\nAn abstract service factory for the [laminas/laminas-servicemanager][2] and any other dependency injection container\nwho's been able to handle it's config, like [chubbyphp/chubbyphp-container][3] via [chubbyphp/chubbyphp-laminas-config][4]\nand many (Aura.Di, Pimple, Auryn, Symfony, PHP-DI) more.\n\nThe original concept of this abstract service factory is by [@DASPRiD][5] used in [dasprid/container-interop-doctrine][6]\nwhich was handed over to [roave/psr-container-doctrine][7].\n\nSmall adjustments and the possibility to use the concept as a basis for all service factories led me to make it\navailable as an independent repository.\n\n## Requirements\n\n * php: ^8.2\n * [psr/container][10]: ^2.0.2\n\n## Installation\n\nThrough [Composer](http://getcomposer.org) as [chubbyphp/chubbyphp-laminas-config-factory][1].\n\n```sh\ncomposer require chubbyphp/chubbyphp-laminas-config-factory \"^1.4\"\n```\n\n## Usage\n\n```php\n\u003c?php\n\ndeclare(strict_types=1);\n\nnamespace MyProject\\Factory;\n\nuse Chubbyphp\\Laminas\\Config\\Factory\\AbstractFactory;\nuse MyProject\\Service\\ServiceA;\nuse MyProject\\Service\\ServiceB;\nuse MyProject\\Service\\ServiceC;\nuse Psr\\Container\\ContainerInterface;\n\nfinal class ServiceAFactory extends AbstractFactory\n{\n    public function __invoke(ContainerInterface $container): ServiceA\n    {\n        return new ServiceA(\n            $this-\u003eresolveConfig($container-\u003eget('config')['serviceA'] ?? []),\n            $this-\u003eresolveDependency($container, ServiceB::class, ServiceBFactory::class),\n            $this-\u003eresolveDependency($container, ServiceC::class, ServiceCFactory::class)\n        );\n    }\n}\n\n/** @var ContainerInterface $container */\n$container = ...;\n\n// without name\n$serviceA = (new ServiceAFactory())($container);\n\n// with name\n$serviceA = [ServiceAFactory::class, 'default']($container);\n```\n\n## Copyright\n\n2025 Dominik Zogg\n\n[1]: https://packagist.org/packages/chubbyphp/chubbyphp-laminas-config-factory\n\n[2]: https://packagist.org/packages/laminas/laminas-servicemanager\n[3]: https://packagist.org/packages/chubbyphp/chubbyphp-container\n[4]: https://packagist.org/packages/chubbyphp/chubbyphp-laminas-config\n[5]: https://github.com/DASPRiD\n[6]: https://packagist.org/packages/dasprid/container-interop-doctrine\n[7]: https://packagist.org/packages/roave/psr-container-doctrine\n\n[10]: https://packagist.org/packages/psr/container\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchubbyphp%2Fchubbyphp-laminas-config-factory","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchubbyphp%2Fchubbyphp-laminas-config-factory","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchubbyphp%2Fchubbyphp-laminas-config-factory/lists"}