https://github.com/chubbyphp/chubbyphp-laminas-config-factory
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.
https://github.com/chubbyphp/chubbyphp-laminas-config-factory
chubbyphp chubbyphp-container laminas mezzio psr-11
Last synced: 8 days ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/chubbyphp/chubbyphp-laminas-config-factory
- Owner: chubbyphp
- License: mit
- Created: 2020-09-04T20:02:20.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2025-03-12T14:09:20.000Z (about 1 month ago)
- Last Synced: 2025-03-27T18:55:27.065Z (25 days ago)
- Topics: chubbyphp, chubbyphp-container, laminas, mezzio, psr-11
- Language: PHP
- Homepage:
- Size: 37.1 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# chubbyphp-laminas-config-factory
[](https://github.com/chubbyphp/chubbyphp-laminas-config-factory/actions/workflows/ci.yml)
[](https://coveralls.io/github/chubbyphp/chubbyphp-laminas-config-factory?branch=master)
[](https://dashboard.stryker-mutator.io/reports/github.com/chubbyphp/chubbyphp-laminas-config-factory/master)
[](https://packagist.org/packages/chubbyphp/chubbyphp-laminas-config-factory)
[](https://packagist.org/packages/chubbyphp/chubbyphp-laminas-config-factory)
[](https://packagist.org/packages/chubbyphp/chubbyphp-laminas-config-factory)[](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-laminas-config-factory)
[](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-laminas-config-factory)
[](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-laminas-config-factory)
[](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-laminas-config-factory)
[](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-laminas-config-factory)
[](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-laminas-config-factory)
[](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-laminas-config-factory)
[](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-laminas-config-factory)
[](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-laminas-config-factory)
[](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-laminas-config-factory)
[](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-laminas-config-factory)## Description
An abstract service factory for the [laminas/laminas-servicemanager][2] and any other dependency injection container
who's been able to handle it's config, like [chubbyphp/chubbyphp-container][3] via [chubbyphp/chubbyphp-laminas-config][4]
and many (Aura.Di, Pimple, Auryn, Symfony, PHP-DI) more.The original concept of this abstract service factory is by [@DASPRiD][5] used in [dasprid/container-interop-doctrine][6]
which was handed over to [roave/psr-container-doctrine][7].Small adjustments and the possibility to use the concept as a basis for all service factories led me to make it
available as an independent repository.## Requirements
* php: ^8.2
* [psr/container][10]: ^2.0.2## Installation
Through [Composer](http://getcomposer.org) as [chubbyphp/chubbyphp-laminas-config-factory][1].
```sh
composer require chubbyphp/chubbyphp-laminas-config-factory "^1.4"
```## Usage
```php
resolveConfig($container->get('config')['serviceA'] ?? []),
$this->resolveDependency($container, ServiceB::class, ServiceBFactory::class),
$this->resolveDependency($container, ServiceC::class, ServiceCFactory::class)
);
}
}/** @var ContainerInterface $container */
$container = ...;// without name
$serviceA = (new ServiceAFactory())($container);// with name
$serviceA = [ServiceAFactory::class, 'default']($container);
```## Copyright
2025 Dominik Zogg
[1]: https://packagist.org/packages/chubbyphp/chubbyphp-laminas-config-factory
[2]: https://packagist.org/packages/laminas/laminas-servicemanager
[3]: https://packagist.org/packages/chubbyphp/chubbyphp-container
[4]: https://packagist.org/packages/chubbyphp/chubbyphp-laminas-config
[5]: https://github.com/DASPRiD
[6]: https://packagist.org/packages/dasprid/container-interop-doctrine
[7]: https://packagist.org/packages/roave/psr-container-doctrine[10]: https://packagist.org/packages/psr/container