Download the PHP package thecodingmachine/common-factories without Composer
On this page you can find all versions of the php package thecodingmachine/common-factories. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download thecodingmachine/common-factories
More information about thecodingmachine/common-factories
Files in thecodingmachine/common-factories
Package common-factories
Short Description This project provides utility factories that can be used directly in service providers complying with the container-interop/service-provider standard.
License MIT
Informations about the package common-factories
Utility factories for container-interop/service-provider
Work in progress.
This project is part of the container-interop group. It tries to find a solution for cross-framework modules (aka bundles) by the means of container-agnostic configuration.
Goal of this project
This project provides utility factories that can be used directly in service providers complying with the container-interop/service-provider standard.
Those common factories can be detected by compiled/cached containers. The aim of this package is to offer a common set of useful classes that can also be preprocessed by optimized containers for best performance.
Usage
Simply require this package in your package declaring your service-provider:
So far, the package has the thecodingmachine vendor name. It will hopefully be migrated to container-interop/common-factories
Then, you can use one of the 3 available classes:
Creating an alias
Use the Alias
class to easily create an alias.
can easily replace:
Creating a parameter
Use the Parameter
class to put in the container a scalar (or array of scalar) entry:
can easily replace:
Appending a service to an array of services
Use the AddToArray
class to push a new service to an existing array:
can easily replace:
All versions of common-factories with dependencies
psr/container Version ^1.0
container-interop/service-provider Version ^0.4